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