| 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) |
||
| 36 | |||
| 37 | public function deleteAttachment(Attachment $attachment) |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Check if model has attachments |
||
| 44 | */ |
||
| 45 | public function hasAttachments() |
||
| 49 | } |
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: