1 | <?php |
||
19 | class Docs extends Model |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $table = 'docs'; |
||
25 | |||
26 | /** |
||
27 | * @return HasMany |
||
28 | */ |
||
29 | public function pages(): HasMany |
||
33 | |||
34 | /** |
||
35 | * @param string $title |
||
36 | * @return string |
||
37 | */ |
||
38 | public function getTitleAttribute(string $title): string |
||
42 | } |
||
43 |
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.