1 | <?php |
||
13 | class Article extends Model |
||
14 | { |
||
15 | use Countable, |
||
16 | Sluggable; |
||
17 | |||
18 | /** |
||
19 | * The "booting" method of the model. |
||
20 | * |
||
21 | * @return void |
||
22 | */ |
||
23 | protected static function boot() |
||
44 | |||
45 | /** |
||
46 | * Return the field to slug. |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | public function slugStrategy(): string |
||
54 | |||
55 | /** |
||
56 | * Return the count cache configuration. |
||
57 | * |
||
58 | * @return array |
||
59 | */ |
||
60 | public function countCaches(): array |
||
67 | |||
68 | /** |
||
69 | * Get the category that owns the article. |
||
70 | * |
||
71 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
72 | */ |
||
73 | public function category() |
||
77 | |||
78 | /** |
||
79 | * Get the user that owns the article. |
||
80 | * |
||
81 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
82 | */ |
||
83 | public function user() |
||
87 | |||
88 | /** |
||
89 | * Get the comments for the article. |
||
90 | * |
||
91 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
92 | */ |
||
93 | public function comments() |
||
97 | } |
||
98 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: