name('Project') ->model(Project::class) ->expectsJsonData() ->itemKey('project') ->collectionKey('projects') ; /** transformer **/ $this ->transformer(ProjectTransformer::class); /** handler **/ $this ->handler(ProjectController::class); /** general roles **/ $this ->allow(AclRoles::AUTHORIZED); /** endpoints **/ $this ->endpoint(ApiEndpoint::post('/test_post/{id}', 'test_post') ->description('Just for test post query') ) ->endpoint(ApiEndpoint::get('/test_get/{id}', 'test_get') ->description('Just for test get query') ) ->endpoint(ApiEndpoint::all()) ->endpoint(ApiEndpoint::create()) ->endpoint(ApiEndpoint::find()) ->endpoint(ApiEndpoint::update()) ->endpoint(ApiEndpoint::remove()) ; } }