| 1 | <?php |
||
| 16 | class Invite extends Model |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * The attributes that should be casted to native types. |
||
| 20 | * |
||
| 21 | * @var string[] |
||
| 22 | */ |
||
| 23 | protected $casts = [ |
||
| 24 | 'email' => 'string', |
||
| 25 | ]; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * The fillable properties. |
||
| 29 | * |
||
| 30 | * @var string[] |
||
| 31 | */ |
||
| 32 | protected $fillable = ['email']; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Overrides the models boot method. |
||
| 36 | */ |
||
| 37 | public static function boot() |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Returns an invite code. |
||
| 50 | * |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | public static function generateInviteCode() |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Determines if the invite was claimed. |
||
| 60 | * |
||
| 61 | * @return bool |
||
| 62 | */ |
||
| 63 | public function claimed() |
||
| 67 | } |
||
| 68 |
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@propertyannotation 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.