Ejemplo n.º 1
0
 /**
  * Return all Permissions with Roles.
  * @return \Illuminate\Database\Eloquent\Collection|static[]
  */
 protected function getPermissions()
 {
     if (!$this->tablePermissionsExists()) {
         return [];
     }
     return Permission::with('roles')->get();
 }
 /**
  * @param  string  $order_by
  * @param  string  $sort
  * @param  bool    $withRoles
  * @return mixed
  */
 public function getAllPermissions($order_by = 'id', $sort = 'asc', $withRoles = true)
 {
     if ($withRoles) {
         return Permission::with('roles')->orderBy($order_by, $sort)->get();
     }
     return Permission::orderBy($order_by, $sort)->get();
 }
Ejemplo n.º 3
0
 protected function getPermissions()
 {
     return Permission::with('roles')->get();
 }
Ejemplo n.º 4
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $data['user'] = User::with('individual')->find($id);
     $data['perms'] = Permission::with('society')->where('user_id', '=', $id)->get();
     return View::make('users.show', $data);
 }
 public function getPermissions()
 {
     return Permission::with('roles')->get();
 }