/** * Muestra una vista con los permisos */ public function showPermissions($id) { $module = Module::findOrFail($id); $roles = Roles::all(['id', 'slug', 'name', 'permissions']); $moduleRole = ModuleRole::getModuleRoleByModule($id); return view("admin.module_role.edit")->with(['module' => $module, 'roles' => $roles, 'moduleRole' => $moduleRole]); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $roles = Roles::findOrFail($id); return view("admin.roles.edit", compact('roles')); }
/** * Show the form for creating a new resource. * * @return Response */ public function create() { $roles = Roles::all(['id', 'name'])->lists('name', 'id'); //dd($roles); return view('admin.users.create', compact('roles', $roles)); }
public static function getRoles($param) { return Roles::whereRaw("(slug like '%{$param}%' or name like '%{$param}%')"); }