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() |
||
49 | |||
50 | /** |
||
51 | * Return the field to slug. |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | public function slugStrategy(): string |
||
59 | |||
60 | /** |
||
61 | * Return the count cache configuration. |
||
62 | * |
||
63 | * @return array |
||
64 | */ |
||
65 | public function countCaches(): array |
||
72 | |||
73 | /** |
||
74 | * Get the category that owns the article. |
||
75 | * |
||
76 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
77 | */ |
||
78 | public function category() |
||
82 | |||
83 | /** |
||
84 | * Get the user that owns the article. |
||
85 | * |
||
86 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
87 | */ |
||
88 | public function user() |
||
92 | |||
93 | /** |
||
94 | * Get the comments for the article. |
||
95 | * |
||
96 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
97 | */ |
||
98 | public function comments() |
||
102 | } |
||
103 |
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: