1 | <?php |
||
8 | class User extends Authenticatable |
||
9 | { |
||
10 | use Notifiable; |
||
11 | |||
12 | /** |
||
13 | * The attributes that are mass assignable. |
||
14 | * |
||
15 | * @var array |
||
16 | */ |
||
17 | protected $fillable = [ |
||
18 | 'name', |
||
19 | 'email', |
||
20 | 'password', |
||
21 | 'email_token', |
||
22 | 'activated', |
||
23 | ]; |
||
24 | |||
25 | /** |
||
26 | * The attributes that should be hidden for arrays. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $hidden = [ |
||
31 | 'password', |
||
32 | 'remember_token', |
||
33 | ]; |
||
34 | |||
35 | /** |
||
36 | * Return the links for this user. |
||
37 | * |
||
38 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
39 | */ |
||
40 | public function links() |
||
44 | |||
45 | /** |
||
46 | * User is linked to a role. |
||
47 | * |
||
48 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
||
49 | */ |
||
50 | public function roles() |
||
51 | { |
||
52 | return $this->belongsToMany(\App\Role::class)->withTimestamps(); |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Check User role. |
||
57 | * |
||
58 | * @param string $name |
||
59 | * |
||
60 | * @return bool |
||
61 | */ |
||
62 | public function hasRole($name) |
||
72 | |||
73 | /** |
||
74 | * Assign user to role. |
||
75 | * |
||
76 | * @param $role |
||
77 | */ |
||
78 | public function assignRole(Role $role) |
||
82 | |||
83 | /** |
||
84 | * Remove user role. |
||
85 | * |
||
86 | * @param $role |
||
87 | * |
||
88 | * @return int |
||
89 | */ |
||
90 | public function removeRole($role) |
||
94 | |||
95 | /** |
||
96 | * Create a unique email token. |
||
97 | * |
||
98 | * @return int |
||
99 | */ |
||
100 | public function createEmailToken() { |
||
109 | |||
110 | /** |
||
111 | * Verify a user. |
||
112 | */ |
||
113 | public function verified() |
||
119 | } |
||
120 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.