|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Yeelight\Models\Foundation; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\Auth\Authenticatable; |
|
6
|
|
|
use Illuminate\Auth\Passwords\CanResetPassword; |
|
7
|
|
|
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract; |
|
8
|
|
|
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; |
|
9
|
|
|
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; |
|
10
|
|
|
use Illuminate\Foundation\Auth\Access\Authorizable; |
|
11
|
|
|
use Illuminate\Notifications\Notifiable; |
|
12
|
|
|
use Laravel\Passport\HasApiTokens; |
|
13
|
|
|
use Prettus\Repository\Contracts\Transformable; |
|
14
|
|
|
use Prettus\Repository\Traits\TransformableTrait; |
|
15
|
|
|
use Yeelight\Base\Models\BaseModel; |
|
16
|
|
|
use Yeelight\Models\Interfaces\BaseModelEventsInterface; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Class BaseUser |
|
20
|
|
|
* |
|
21
|
|
|
* @category Yeelight |
|
22
|
|
|
* |
|
23
|
|
|
* @package Yeelight\Models\Foundation |
|
24
|
|
|
* |
|
25
|
|
|
* @author Sheldon Lee <[email protected]> |
|
26
|
|
|
* |
|
27
|
|
|
* @license https://opensource.org/licenses/MIT MIT |
|
28
|
|
|
* |
|
29
|
|
|
* @link https://www.yeelight.com |
|
30
|
|
|
* |
|
31
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Laravel\Passport\Client[] $clients |
|
32
|
|
|
* @property-read mixed $id |
|
33
|
|
|
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications |
|
34
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Laravel\Passport\Token[] $tokens |
|
35
|
|
|
* @mixin \Eloquent |
|
36
|
|
|
*/ |
|
37
|
|
|
class BaseUser extends BaseModel implements |
|
38
|
|
|
BaseModelEventsInterface, |
|
39
|
|
|
AuthenticatableContract, |
|
40
|
|
|
AuthorizableContract, |
|
41
|
|
|
CanResetPasswordContract, |
|
42
|
|
|
Transformable |
|
43
|
|
|
{ |
|
44
|
|
|
use Authenticatable, Authorizable, CanResetPassword; |
|
|
|
|
|
|
45
|
|
|
use TransformableTrait; |
|
46
|
|
|
use HasApiTokens, Notifiable; |
|
|
|
|
|
|
47
|
|
|
|
|
48
|
|
|
const MORPH_NAME = 'User'; |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* Indicates if the model should be auto set user_id. |
|
52
|
|
|
* |
|
53
|
|
|
* @var bool |
|
54
|
|
|
*/ |
|
55
|
|
|
protected $autoUserId = false; |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* The primary key for the model. |
|
59
|
|
|
* |
|
60
|
|
|
* @var string |
|
61
|
|
|
*/ |
|
62
|
|
|
protected $primaryKey = 'user_id'; |
|
63
|
|
|
|
|
64
|
|
|
public function onCreating() |
|
65
|
|
|
{ |
|
66
|
|
|
// TODO: Implement onCreating() method. |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
public function onCreated() |
|
70
|
|
|
{ |
|
71
|
|
|
// TODO: Implement onCreated() method. |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
public function onUpdating() |
|
75
|
|
|
{ |
|
76
|
|
|
// TODO: Implement onUpdating() method. |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
public function onUpdated() |
|
80
|
|
|
{ |
|
81
|
|
|
// TODO: Implement onUpdated() method. |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
public function onSaving() |
|
85
|
|
|
{ |
|
86
|
|
|
// TODO: Implement onSaving() method. |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
public function onSaved() |
|
90
|
|
|
{ |
|
91
|
|
|
// TODO: Implement onSaved() method. |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
public function onDeleting() |
|
95
|
|
|
{ |
|
96
|
|
|
// TODO: Implement onDeleting() method. |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
public function onDeleted() |
|
100
|
|
|
{ |
|
101
|
|
|
// TODO: Implement onDeleted() method. |
|
102
|
|
|
} |
|
103
|
|
|
|
|
104
|
|
|
public function onRestoring() |
|
105
|
|
|
{ |
|
106
|
|
|
// TODO: Implement onRestoring() method. |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
public function onRestored() |
|
110
|
|
|
{ |
|
111
|
|
|
// TODO: Implement onRestored() method. |
|
112
|
|
|
} |
|
113
|
|
|
} |
|
114
|
|
|
|