1 | <?php |
||
19 | class Subscriber extends Model implements HasPresenter |
||
20 | { |
||
21 | use ValidatingTrait; |
||
22 | |||
23 | /** |
||
24 | * The attributes that should be casted to native types. |
||
25 | * |
||
26 | * @var string[] |
||
27 | */ |
||
28 | protected $casts = [ |
||
29 | 'id' => 'int', |
||
30 | 'email' => 'string', |
||
31 | 'verify_code' => 'string', |
||
32 | 'verified_at' => 'date', |
||
33 | ]; |
||
34 | |||
35 | /** |
||
36 | * The fillable properties. |
||
37 | * |
||
38 | * @var string[] |
||
39 | */ |
||
40 | protected $fillable = ['email']; |
||
41 | |||
42 | /** |
||
43 | * The validation rules. |
||
44 | * |
||
45 | * @var string[] |
||
46 | */ |
||
47 | public $rules = [ |
||
48 | 'email' => 'required|email', |
||
49 | ]; |
||
50 | |||
51 | /** |
||
52 | * Overrides the models boot method. |
||
53 | */ |
||
54 | public static function boot() |
||
64 | |||
65 | /** |
||
66 | * Determines if the subscriber is verified. |
||
67 | * |
||
68 | * @return bool |
||
69 | */ |
||
70 | public function verified() |
||
74 | |||
75 | /** |
||
76 | * Returns an new verify code. |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | public static function generateVerifyCode() |
||
84 | |||
85 | /** |
||
86 | * Get the presenter class. |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | public function getPresenterClass() |
||
94 | } |
||
95 |
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.