| 1 | <?php namespace Arcanesoft\Auth\Models\Presenters; |
||
| 13 | trait UserPresenter |
||
| 14 | { |
||
| 15 | /* ------------------------------------------------------------------------------------------------ |
||
| 16 | | Traits |
||
| 17 | | ------------------------------------------------------------------------------------------------ |
||
| 18 | */ |
||
| 19 | use HasherTrait; |
||
| 20 | |||
| 21 | /* ------------------------------------------------------------------------------------------------ |
||
| 22 | | Getters & Setters |
||
| 23 | | ------------------------------------------------------------------------------------------------ |
||
| 24 | */ |
||
| 25 | /** |
||
| 26 | * Get the full name attribute or use the username if empty. |
||
| 27 | * |
||
| 28 | * @return string |
||
| 29 | */ |
||
| 30 | public function getFullNameAttribute() |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Get the since date attribute (translated). |
||
| 39 | * |
||
| 40 | * @return string |
||
| 41 | */ |
||
| 42 | public function getSinceDateAttribute() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Get the gravatar attribute. |
||
| 51 | * |
||
| 52 | * @return string |
||
| 53 | */ |
||
| 54 | public function getGravatarAttribute() |
||
| 60 | } |
||
| 61 |
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: