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