1 | <?php namespace Afrittella\BackProject\Traits; |
||
6 | trait Attachable |
||
7 | { |
||
8 | |||
9 | public static function boot() |
||
18 | |||
19 | public function addAttachment($data = []) |
||
32 | |||
33 | public function deleteAttachment(Attachment $attachment) |
||
37 | |||
38 | /** |
||
39 | * Check if model has attachments |
||
40 | */ |
||
41 | public function hasAttachments() |
||
45 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: