getRouteKey(); } public function title() { if ($this->title != '') { return $this->title; } if ($this->name != '') { return $this->name; } return 'None'; } public function toArray() { return [ 'id' => $this->getRouteKey(), 'title' => $this->title(), 'job_title' => $this->job_title, 'slug' => $this->slug, 'meta_titile' => $this->meta_titile, 'job_category' => $this->job_category, 'job_description' => $this->job_description, 'job_task' => $this->job_task, 'job_extra_points' => $this->job_extra_points, 'images' => $this->images, 'status' => $this->status, 'created_at' => !is_null($this->created_at) ? $this->created_at->format('Y-m-d H:i:s') : null, 'updated_at' => !is_null($this->updated_at) ? $this->updated_at->format('Y-m-d H:i:s') : null, 'meta' => [ 'exists' => $this->exists(), 'link' => $this->itemLink(), 'upload_url' => $this->getUploadURL(''), ], ]; } }