Commit 175f1d0b1bc6cf7d3a85a37db0684cbfa7300116
1 parent
3ef115a0
registration
Showing
3 changed files
with
14 additions
and
15 deletions
Show diff stats
app/library/App/Controllers/UserController.php
| ... | ... | @@ -63,7 +63,6 @@ class UserController extends CrudResourceController |
| 63 | 63 | $user = new User(); |
| 64 | 64 | $user->username = 'test33233222'; |
| 65 | 65 | $user->save(); |
| 66 | - $user->refresh(); | |
| 67 | 66 | |
| 68 | 67 | echo $user->id; |
| 69 | 68 | |
| ... | ... | @@ -96,14 +95,14 @@ class UserController extends CrudResourceController |
| 96 | 95 | |
| 97 | 96 | } |
| 98 | 97 | |
| 99 | - public function whitelist() | |
| 100 | - { | |
| 101 | - return [ | |
| 102 | - 'username', | |
| 103 | - 'password', | |
| 104 | - 'email' | |
| 105 | - ]; | |
| 106 | - } | |
| 98 | +// public function whitelist() | |
| 99 | +// { | |
| 100 | +// return [ | |
| 101 | +// 'username', | |
| 102 | +// 'password', | |
| 103 | +// 'email' | |
| 104 | +// ]; | |
| 105 | +// } | |
| 107 | 106 | |
| 108 | 107 | protected function getModelPrimaryKey() |
| 109 | 108 | { | ... | ... |
app/library/App/Model/Project.php
| ... | ... | @@ -26,8 +26,8 @@ class Project extends \App\Mvc\DateTrackingModel |
| 26 | 26 | |
| 27 | 27 | public function initialize() { |
| 28 | 28 | |
| 29 | -// $this->belongsTo('user_id', User::class, 'id', [ | |
| 30 | -// 'alias' => 'User', | |
| 31 | -// ]); | |
| 29 | + $this->belongsTo('user_id', User::class, 'id', [ | |
| 30 | + 'alias' => 'User', | |
| 31 | + ]); | |
| 32 | 32 | } |
| 33 | 33 | } | ... | ... |
app/library/App/Model/User.php
| ... | ... | @@ -27,9 +27,9 @@ class User extends \App\Mvc\DateTrackingModel |
| 27 | 27 | |
| 28 | 28 | public function initialize() |
| 29 | 29 | { |
| 30 | -// $this->hasMany('id', Project::class, 'user_id', [ | |
| 31 | -// 'alias' => 'Projects', | |
| 32 | -// ]); | |
| 30 | + $this->hasMany('id', Project::class, 'user_id', [ | |
| 31 | + 'alias' => 'Projects', | |
| 32 | + ]); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | } | ... | ... |