+
+ public function getCreatedAttribute() {
+ $created = [
+ 'day_time_str' => $this->created_at->toDayDateTimeString(),
+ 'diff' => $this->created_at->diffForHumans()
+ ];
+ return $created;
+ }
+
+ public function getUpdatedAttribute() {
+ if (empty($this->updated_at)) {
+ return null;
+ }
+ $updated = [
+ 'day_time_str' => $this->updated_at->toDayDateTimeString(),
+ 'diff' => $this->updated_at->diffForHumans()
+ ];
+ return $updated;
+ }