Commit 141eacf0162c80ba1c7f7708b18bbb4723bb10a0
1 parent
5df28bdb
project entity
Showing
2 changed files
with
10 additions
and
8 deletions
Show diff stats
app/library/App/Model/Project.php
| @@ -29,11 +29,11 @@ class Project extends \App\Mvc\DateTrackingModel { | @@ -29,11 +29,11 @@ class Project extends \App\Mvc\DateTrackingModel { | ||
| 29 | ]; | 29 | ]; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | - public function initialize() { | ||
| 33 | - | ||
| 34 | - $this->belongsTo('user_id', User::class, 'id', [ | ||
| 35 | - 'alias' => 'User', | ||
| 36 | - ]); | ||
| 37 | - } | 32 | +// public function initialize() { |
| 33 | +// | ||
| 34 | +// $this->belongsTo('user_id', User::class, 'id', [ | ||
| 35 | +// 'alias' => 'User', | ||
| 36 | +// ]); | ||
| 37 | +// } | ||
| 38 | 38 | ||
| 39 | } | 39 | } |
| 40 | \ No newline at end of file | 40 | \ No newline at end of file |
app/library/App/Resources/ProjectResource.php
| @@ -26,9 +26,11 @@ class ProjectResource extends ApiResource { | @@ -26,9 +26,11 @@ class ProjectResource extends ApiResource { | ||
| 26 | ->expectsJsonData() | 26 | ->expectsJsonData() |
| 27 | ->transformer(ProjectTransformer::class) | 27 | ->transformer(ProjectTransformer::class) |
| 28 | ->handler(CrudResourceController::class) | 28 | ->handler(CrudResourceController::class) |
| 29 | - ->itemKey('project') | 29 | + ->singleKey('project') |
| 30 | + ->multipleKey('projects') | ||
| 31 | + //->itemKey('project') | ||
| 30 | ->collectionKey('projects') | 32 | ->collectionKey('projects') |
| 31 | - ->deny(AclRoles::UNAUTHORIZED) | 33 | + ->alow(AclRoles::USER) |
| 32 | 34 | ||
| 33 | ->endpoint(ApiEndpoint::all()) | 35 | ->endpoint(ApiEndpoint::all()) |
| 34 | ->endpoint(ApiEndpoint::create()) | 36 | ->endpoint(ApiEndpoint::create()) |