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(), 'title' => $this->title, 'category_id' => $this->category_id, 'subcategory_id' => $this->subcategory_id, 'city_id' => $this->city_id, 'district_id' => $this->district_id, 'state_id' => $this->state_id, 'country_id' => $this->country_id, 'zipcode' => $this->zipcode, 'detail' => $this->detail, 'location' => $this->location, 'lattitude' => $this->lattitude, 'longitude' => $this->longitude, 'phone' => $this->phone, 'website' => $this->website, 'description' => $this->description, 'openig_hours' => $this->openig_hours, 'features' => $this->features, 'tags' => $this->tags, 'yellopage_type' => $this->yellopage_type, 'images' => $this->images, '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(''), ], ]; } }