1 | <?php namespace Arcanedev\LaravelTracker\Models\Presenters; |
||
11 | trait SessionPresenter |
||
12 | { |
||
13 | /* ------------------------------------------------------------------------------------------------ |
||
14 | | Main Functions |
||
15 | | ------------------------------------------------------------------------------------------------ |
||
16 | */ |
||
17 | /** |
||
18 | * Get the `location_name` attribute. |
||
19 | * |
||
20 | * @return string |
||
21 | */ |
||
22 | public function getLocationNameAttribute() |
||
29 | } |
||
30 |
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: