1 | <?php namespace WITR; |
||
9 | class User extends Model implements AuthenticatableContract, CanResetPasswordContract { |
||
10 | |||
11 | use Authenticatable, CanResetPassword; |
||
12 | |||
13 | /** |
||
14 | * The database table used by the model. |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $table = 'user'; |
||
19 | |||
20 | /** |
||
21 | * The attributes that are mass assignable. |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $fillable = ['name', 'email', 'password', 'picture', 'user_role']; |
||
26 | |||
27 | /** |
||
28 | * The attributes excluded from the model's JSON form. |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $hidden = ['password', 'remember_token']; |
||
33 | |||
34 | public $timestamps = false; |
||
35 | |||
36 | /** |
||
37 | * @return mixed |
||
38 | */ |
||
39 | public function role() |
||
43 | |||
44 | /** |
||
45 | * Does the user have a particular role? |
||
46 | * |
||
47 | * @param $name |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function hasRole($name) |
||
54 | } |
||
55 |
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.