1 | <?php |
||
16 | trait TimestampsTrait |
||
17 | { |
||
18 | /** |
||
19 | * Present formatted date time. |
||
20 | * |
||
21 | * @return string |
||
22 | */ |
||
23 | public function created_at() |
||
28 | |||
29 | /** |
||
30 | * Present diff for humans date time. |
||
31 | * |
||
32 | * @return string |
||
33 | */ |
||
34 | public function created_at_diff() |
||
40 | |||
41 | /** |
||
42 | * Present formatted date time. |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | public function created_at_formatted() |
||
52 | |||
53 | /** |
||
54 | * Present formatted date time. |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | public function created_at_iso() |
||
62 | |||
63 | /** |
||
64 | * Present formatted date time. |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | public function updated_at() |
||
73 | |||
74 | /** |
||
75 | * Present formatted date time. |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | public function deleted_at() |
||
84 | |||
85 | /** |
||
86 | * Present formatted date time. |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | public function verified_at() |
||
95 | } |
||
96 |
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: