public static function boot() { parent::boot(); static::deleted(function ($pod) { PodBattery::destroy($pod->batteries()->lists('id')); PodUp::destroy($pod->ups()->lists('id')); Cord::destroy($pod->cords()->lists('id')); }); }
/** * Remove the specified cord from storage. * * @param int $id * @return Response */ public function destroy($id) { Cord::destroy($id); return Redirect::route('cords.index'); }