1 | <?php |
||
41 | class Comment extends Model implements HasPresenter |
||
42 | { |
||
43 | use SoftDeletes, ValidatingTrait; |
||
44 | |||
45 | /** |
||
46 | * The attributes that should be casted to native types. |
||
47 | * |
||
48 | * @var string[] |
||
49 | */ |
||
50 | protected $casts = [ |
||
51 | 'id' => 'int', |
||
52 | 'deleted_at' => 'date', |
||
53 | ]; |
||
54 | |||
55 | /** |
||
56 | * The fillable properties. |
||
57 | * |
||
58 | * @var string[] |
||
59 | */ |
||
60 | protected $fillable = [ |
||
61 | 'message', |
||
62 | 'target_type', |
||
63 | 'target_id', |
||
64 | 'author_id', |
||
65 | 'project_id', |
||
66 | 'created_at', |
||
67 | 'updated_at', |
||
68 | ]; |
||
69 | |||
70 | /** |
||
71 | * The validation rules. |
||
72 | * |
||
73 | * @var string[] |
||
74 | */ |
||
75 | public $rules = [ |
||
76 | 'author_id' => 'int', |
||
77 | 'project_id' => 'int', |
||
78 | 'message' => 'required', |
||
79 | 'target_type' => 'string|required', |
||
80 | 'target_id' => 'int', |
||
81 | ]; |
||
82 | |||
83 | /** |
||
84 | * A comment belongs to a project. |
||
85 | * |
||
86 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
87 | */ |
||
88 | public function project() |
||
92 | |||
93 | /** |
||
94 | * Moments can belong to a target. |
||
95 | * |
||
96 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
97 | */ |
||
98 | public function target() |
||
102 | |||
103 | /** |
||
104 | * Get the presenter class. |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | public function getPresenterClass() |
||
112 | } |
||
113 |
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.