1 | <?php |
||
39 | class User extends Model implements AuthenticatableContract, CanResetPasswordContract |
||
40 | { |
||
41 | use Authenticatable, |
||
42 | CanResetPassword, |
||
43 | Traits\User\CountTrait, |
||
44 | Traits\User\RelationTrait, |
||
45 | Traits\User\CrudTrait, |
||
46 | Traits\User\QueryTrait; |
||
47 | |||
48 | /** |
||
49 | * User name is private. |
||
50 | * |
||
51 | * @var int |
||
52 | */ |
||
53 | const PRIVATE_YES = 1; |
||
54 | |||
55 | /** |
||
56 | * User name is public. |
||
57 | * |
||
58 | * @var int |
||
59 | */ |
||
60 | const PRIVATE_NO = 0; |
||
61 | |||
62 | /** |
||
63 | * User status Deleted. |
||
64 | * |
||
65 | * @var int |
||
66 | */ |
||
67 | const DELETED_USERS = 1; |
||
68 | |||
69 | /** |
||
70 | * User status not deleted. |
||
71 | * |
||
72 | * @var int |
||
73 | */ |
||
74 | const NOT_DELETED_USERS = 0; |
||
75 | |||
76 | /** |
||
77 | * The database table used by the model. |
||
78 | * |
||
79 | * @var string |
||
80 | */ |
||
81 | protected $table = 'users'; |
||
82 | |||
83 | /** |
||
84 | * The attributes that are mass assignable. |
||
85 | * |
||
86 | * @var array |
||
87 | */ |
||
88 | protected $fillable = ['deleted', 'email', 'password', 'firstname', 'lastname', 'role_id', 'private', 'language']; |
||
89 | |||
90 | /** |
||
91 | * The attributes excluded from the model's JSON form. |
||
92 | * |
||
93 | * @var array |
||
94 | */ |
||
95 | protected $hidden = ['password', 'remember_token']; |
||
96 | |||
97 | /** |
||
98 | * Collection of user permissions. |
||
99 | * |
||
100 | * @var Eloquent\Collection |
||
101 | */ |
||
102 | protected $permission; |
||
103 | |||
104 | /** |
||
105 | * Get available languages from translations folder. |
||
106 | * |
||
107 | * @return array |
||
108 | */ |
||
109 | 3 | public static function getLanguages() |
|
122 | |||
123 | /** |
||
124 | * Checks to see if $this user is current user. |
||
125 | * |
||
126 | * @return bool |
||
127 | */ |
||
128 | 3 | public function me() |
|
132 | |||
133 | /** |
||
134 | * Whether or not the user has a valid permission in current context |
||
135 | * e.g. can access the issue or the project. |
||
136 | * |
||
137 | * @param array $params |
||
138 | * |
||
139 | * @return bool |
||
140 | */ |
||
141 | 39 | public function permissionInContext(array $params) |
|
164 | |||
165 | /** |
||
166 | * Whether or not the user has a permission. |
||
167 | * |
||
168 | * @param string $key |
||
169 | * |
||
170 | * @return bool |
||
171 | */ |
||
172 | 54 | public function permission($key) |
|
183 | |||
184 | /** |
||
185 | * Return user full name with property "fullname". |
||
186 | * |
||
187 | * @return string |
||
188 | */ |
||
189 | 39 | public function getFullNameAttribute() |
|
197 | |||
198 | /** |
||
199 | * Return user image. |
||
200 | * |
||
201 | * @return string |
||
202 | */ |
||
203 | public function getImageAttribute() |
||
207 | } |
||
208 |
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.