1 | <?php |
||
25 | class User extends BaseModel implements Authenticatable, Authorizable |
||
26 | { |
||
27 | use HasApiTokens; |
||
28 | use HasRoles; |
||
29 | use AuthorizableTrait; |
||
30 | |||
31 | /** |
||
32 | * The attributes excluded from the model's JSON form. |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $hidden = ['password', 'remember_token']; |
||
37 | |||
38 | protected $attributes = [ |
||
39 | 'language' => 'en', |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * The column name of the "remember me" token. |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $rememberTokenName = 'remember_token'; |
||
48 | |||
49 | protected static function boot() |
||
62 | |||
63 | /** |
||
64 | * Get the name of the unique identifier for the user. |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getAuthIdentifierName() |
||
72 | |||
73 | /** |
||
74 | * Get the unique identifier for the user. |
||
75 | * |
||
76 | * @return mixed |
||
77 | */ |
||
78 | public function getAuthIdentifier() |
||
82 | |||
83 | /** |
||
84 | * Get the password for the user. |
||
85 | * |
||
86 | * @return string |
||
87 | */ |
||
88 | public function getAuthPassword() |
||
92 | |||
93 | /** |
||
94 | * Get the token value for the "remember me" session. |
||
95 | * |
||
96 | * @return string|null |
||
97 | */ |
||
98 | public function getRememberToken() |
||
104 | |||
105 | /** |
||
106 | * Set the token value for the "remember me" session. |
||
107 | * |
||
108 | * @param string $value |
||
109 | * @return void |
||
110 | */ |
||
111 | public function setRememberToken($value) |
||
117 | |||
118 | /** |
||
119 | * Get the column name for the "remember me" token. |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | public function getRememberTokenName() |
||
127 | |||
128 | /** |
||
129 | * Get the author's avatar. |
||
130 | * |
||
131 | * @param string $value |
||
132 | * @return string |
||
133 | */ |
||
134 | public function getAvatarAttribute($value) |
||
140 | |||
141 | public function setPasswordAttribute($value) |
||
145 | } |
||
146 |