/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $role = Role::with(array('permissions' => function ($query) { $query->select('id'); }))->findOrFail($id); $data = array("id" => $role->id, "name" => $role->name, "description" => $role->description, "availPermissions" => Permission::select('id', 'name')->orderBy('name')->lists('name', 'id'), "assignedPermissions" => $role->permissions->lists('id')); return view('larbac::roles.edit-role', $data); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $p = Permission::findOrFail($id); $p->delete(); return redirect(route(config('larbac.routes.routePermission') . '.index')); }