From 141eacf0162c80ba1c7f7708b18bbb4723bb10a0 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 6 Feb 2017 18:12:29 +0200 Subject: [PATCH] project entity --- app/library/App/Model/Project.php | 12 ++++++------ app/library/App/Resources/ProjectResource.php | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/library/App/Model/Project.php b/app/library/App/Model/Project.php index bd78b43..16a7d60 100644 --- a/app/library/App/Model/Project.php +++ b/app/library/App/Model/Project.php @@ -29,11 +29,11 @@ class Project extends \App\Mvc\DateTrackingModel { ]; } - public function initialize() { - - $this->belongsTo('user_id', User::class, 'id', [ - 'alias' => 'User', - ]); - } +// public function initialize() { +// +// $this->belongsTo('user_id', User::class, 'id', [ +// 'alias' => 'User', +// ]); +// } } \ No newline at end of file diff --git a/app/library/App/Resources/ProjectResource.php b/app/library/App/Resources/ProjectResource.php index c512562..cc5a09b 100644 --- a/app/library/App/Resources/ProjectResource.php +++ b/app/library/App/Resources/ProjectResource.php @@ -26,9 +26,11 @@ class ProjectResource extends ApiResource { ->expectsJsonData() ->transformer(ProjectTransformer::class) ->handler(CrudResourceController::class) - ->itemKey('project') + ->singleKey('project') + ->multipleKey('projects') + //->itemKey('project') ->collectionKey('projects') - ->deny(AclRoles::UNAUTHORIZED) + ->alow(AclRoles::USER) ->endpoint(ApiEndpoint::all()) ->endpoint(ApiEndpoint::create()) -- libgit2 0.21.4