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(), 'name' => $this->name, 'title' => $this->title, 'heading' => $this->heading, 'sub_heading' => $this->sub_heading, 'abstract' => $this->abstract, 'content' => $this->content, 'meta_title' => $this->meta_title, 'meta_keyword' => $this->meta_keyword, 'meta_description' => $this->meta_description, 'banner' => $this->banner, 'images' => $this->images, 'compile' => $this->compile, 'view' => $this->view, 'category' => $this->category, 'order' => $this->order, 'slug' => $this->slug, 'status' => $this->status, 'upload_folder' => $this->upload_folder, '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(''), ], ]; } }