wrappedObject->status) { case 1: return 'greens'; case 2: return 'blues'; case 3: return 'yellows'; case 4: return 'reds'; } } /** * Looks up the human readable version of the status. * * @return string */ public function human_status() { return trans('cachet.components.status.'.$this->wrappedObject->status); } /** * Find all tag names for the component names. * * @return array */ public function tags() { return $this->wrappedObject->tags->pluck('name', 'slug'); } /** * Present formatted date time. * * @return string */ public function updated_at_formatted() { return ucfirst(app(DateFactory::class)->make($this->wrappedObject->updated_at)->format(Config::get('setting.incident_date_format', 'l jS F Y H:i:s'))); } /** * Convert the presenter instance to an array. * * @return string[] */ public function toArray() { return array_merge($this->wrappedObject->toArray(), [ 'created_at' => $this->created_at(), 'updated_at' => $this->updated_at(), 'status_name' => $this->human_status(), 'tags' => $this->tags(), ]); } }