app/Http/Controllers/API/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()
    {
        if(Gate::allows('isAdmin') || Gate::allows('isAuthor') ){
            return User::latest()->paginate(10);
        }
    }
public function index ( ) { if ( Gate :: allows ( 'isAdmin' ) || Gate :: allows ( 'isAuthor' ) ) { return User :: latest ( ) -> paginate ( 10 ) ; } }
Display a listing of the resource.
Display a listing of the resource .
//$this->authorize('isAdmin');