Beispiel #1
0
 /**
  * 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]);
 }
Beispiel #2
0
 /**
  * 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'));
 }
Beispiel #3
0
 /**
  * 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));
 }
Beispiel #4
0
 public static function getRoles($param)
 {
     return Roles::whereRaw("(slug like '%{$param}%' or name like '%{$param}%')");
 }