src/Http/Controllers/Admin/UsersController.php
public function listByRole(Role $role, $trashed = false)
    {
        $this->authorize(UsersPolicy::PERMISSION_LIST);

        $users = $role->users()->with('roles')
            ->protectAdmins()
            ->paginate(30);

        $title = trans('auth::users.titles.users-list')." - {$role->name} Role". ($trashed ? ' - '.trans('core::generals.trashed') : '');
        $this->setTitle($title);
        $this->addBreadcrumb($title);

        return $this->view('admin.users.list', compact('trashed', 'users'));
    }
public function listByRole(Role $role, $trashed = false)
    {
        $this->authorize(UsersPolicy::PERMISSION_LIST);

        $users = $role->users()->with('roles')
            ->protectAdmins()
            ->paginate(30);

        $title = trans('auth::users.titles.users-list')." - {$role->name} Role". ($trashed ? ' - '.trans('core::generals.trashed') : '');
        $this->setTitle($title);
        $this->addBreadcrumb($title);

        return $this->view('admin.users.list', compact('trashed', 'users'));
    }
public function listByRole ( Role $ role , $ trashed = false ) { $ this -> authorize ( UsersPolicy :: PERMISSION_LIST ) ; $ users = $ role -> users ( ) -> with ( 'roles' ) -> protectAdmins ( ) -> paginate ( 30 ) ; $ title = trans ( 'auth::users.titles.users-list' ) . " - {$role->name} Role" . ( $ trashed ? ' - ' . trans ( 'core::generals.trashed' ) : '' ) ; $ this -> setTitle ( $ title ) ; $ this -> addBreadcrumb ( $ title ) ; return $ this -> view ( 'admin.users.list' , compact ( 'trashed' , 'users' ) ) ; }
List the users by a role.

@param  \Arcanesoft\Contracts\Auth\Models\Role  $role
@param  bool                                    $trashed

@return \Illuminate\View\View
List the users by a role .