app/Http/Controllers/UserController.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()
    {
        \Gate::authorize('view', 'users');
        return UserResource::collection(User::with('role')->paginate());
    }
public function index ( ) { \ Gate :: authorize ( 'view' , 'users' ) ; return UserResource :: collection ( User :: with ( 'role' ) -> paginate ( ) ) ; }
Display a listing of the resource.
Display a listing of the resource .