name('Project') ->model(Project::class) ->expectsJsonData() ->itemKey('project') ->collectionKey('projects') ; /** transformers **/ $this ->transformer(ProjectTransformer::class); /** handlers **/ $this ->handler(ProjectController::class) ->handler(CrudResourceController::class); /** general roles **/ $this ->allow(AclRoles::AUTHORIZED); /** endpoints **/ $this ->endpoint(ApiEndpoint::post('/test', 'test') ->description('Returns the currently logged in user') ) ->endpoint(ApiEndpoint::all()) ->endpoint(ApiEndpoint::create()) ->endpoint(ApiEndpoint::find()) ->endpoint(ApiEndpoint::update()) ->endpoint(ApiEndpoint::remove()) ; } }