1 | <?php namespace Arcanesoft\Auth\Models\Presenters; |
||
17 | trait UserPresenter |
||
18 | { |
||
19 | /* ----------------------------------------------------------------- |
||
20 | | Traits |
||
21 | | ----------------------------------------------------------------- |
||
22 | */ |
||
23 | |||
24 | use HasherTrait; |
||
25 | |||
26 | /* ----------------------------------------------------------------- |
||
27 | | Getters & Setters |
||
28 | | ----------------------------------------------------------------- |
||
29 | */ |
||
30 | |||
31 | /** |
||
32 | * Get the `full_name` attribute or use the username if empty. |
||
33 | * |
||
34 | * @return string |
||
35 | */ |
||
36 | public function getFullNameAttribute() |
||
42 | |||
43 | /** |
||
44 | * Get the `since_date` attribute (translated). |
||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | public function getSinceDateAttribute() |
||
54 | |||
55 | /** |
||
56 | * Get the `gravatar` attribute. |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getGravatarAttribute() |
||
66 | |||
67 | /** |
||
68 | * Get the `formatted_last_activity` attribute. |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | public function getFormattedLastActivityAttribute() |
||
78 | } |
||
79 |
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: