1 | <?php |
||
12 | class User extends Authenticatable implements MustVerifyEmail, HasMedia |
||
|
|||
13 | { |
||
14 | use InteractsWithMedia; |
||
15 | |||
16 | /** |
||
17 | * User constructor. |
||
18 | * |
||
19 | * @param array $attributes |
||
20 | */ |
||
21 | public function __construct(array $attributes = []) |
||
29 | |||
30 | /** |
||
31 | * @return BelongsTo |
||
32 | */ |
||
33 | public function role() |
||
37 | |||
38 | /** |
||
39 | * Retrieve role's permissions |
||
40 | * |
||
41 | * @return Collection |
||
42 | */ |
||
43 | public function permissions() |
||
47 | |||
48 | /** |
||
49 | * Register media library collections. |
||
50 | */ |
||
51 | public function registerMediaCollections(): void |
||
58 | |||
59 | /** |
||
60 | * Hash the password whenever updating. |
||
61 | * |
||
62 | * @param $value |
||
63 | */ |
||
64 | public function setPasswordAttribute($value) |
||
68 | |||
69 | /** |
||
70 | * Get user's avatar or get the placeholder |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | public function getAvatarAttribute() |
||
78 | } |
||
79 |