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(), 'user_id' => $this->user_id, 'user_type' => $this->user_type, 'title' => $this->title, 'slug' => $this->slug, 'subtitle' => $this->subtitle, 'description' => $this->description, 'icon' => $this->icon, 'features_icon' => $this->features_icon, 'color' => $this->color, 'meta_title' => $this->meta_title, 'meta_description' => $this->meta_description, 'meta_tags' => $this->meta_tags, 'meta_subtitle' => $this->meta_subtitle, 'highlights' => $this->highlights, 'features' => $this->features, 'images' => $this->images, 'demo_screenshots' => $this->demo_screenshots, 'login_details' => $this->login_details, 'testimonials' => $this->testimonials, 'published' => $this->published, '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(''), ], ]; } }