| 1 | <?php namespace Afrittella\BackProject\Traits; |
||
| 6 | trait Attachable |
||
| 7 | { |
||
| 8 | |||
| 9 | public static function boot() |
||
| 18 | |||
| 19 | public function addAttachment($data = [], $user_id = null) |
||
| 34 | |||
| 35 | public function deleteAttachment(Attachment $attachment) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Check if model has attachments |
||
| 42 | */ |
||
| 43 | public function hasAttachments() |
||
| 47 | } |
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: