getRouteKey(); } public function title() { if ($this->title != '') { return $this->title; } if ($this->name != '') { return $this->name; } return 'None'; } public function toArray($request) { return [ 'id' => $this->getRouteKey(), 'title' => $this->title(), 'title' => $this->title, 'country_id' => $this->country_id, 'state_id' => $this->state_id, 'district_id' => $this->district_id, 'city_id' => $this->city_id, 'location' => $this->location, 'schedule' => $this->schedule, 'responsibilities' => $this->responsibilities, 'desired_candidate_profile' => $this->desired_candidate_profile, 'status' => $this->status, 'slug' => $this->slug, '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(''), ], ]; } }