app/Http/Controllers/AdminUserController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $user = Auth::user();
        if($user->isTeam() && !$user->isAdmin()){
            $users =  User::whereId($user->id)->paginate(10);
            $roles =Role::whereId($user->role_id)->pluck('name','id')->all();
        }
        else{
            $users = User::paginate(10);
            $roles = Role::pluck('name','id')->all();
        }
        return view('admin.users.index', compact('users', 'roles'));
    }
public function index ( ) { $ user = Auth :: user ( ) ; if ( $ user -> isTeam ( ) && ! $ user -> isAdmin ( ) ) { $ users = User :: whereId ( $ user -> id ) -> paginate ( 10 ) ; $ roles = Role :: whereId ( $ user -> role_id ) -> pluck ( 'name' , 'id' ) -> all ( ) ; } else { $ users = User :: paginate ( 10 ) ; $ roles = Role :: pluck ( 'name' , 'id' ) -> all ( ) ; } return view ( 'admin.users.index' , compact ( 'users' , 'roles' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .
//       