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, 'gender' => $this->gender, 'first_name' => $this->first_name, 'last_name' => $this->last_name, 'dob' => $this->dob, 'birthplace' => $this->birthplace, 'country' => $this->country, 'marital_status' => $this->marital_status, 'children' => $this->children, 'religion' => $this->religion, 'profile_pitcure' => $this->profile_pitcure, 'email' => $this->email, 'phone' => $this->phone, 'whatsapp_number' => $this->whatsapp_number, 'skype_id' => $this->skype_id, 'zoom_id' => $this->zoom_id, 'live_in_germany' => $this->live_in_germany, 'living_in_germany_from' => $this->living_in_germany_from, 'address_country' => $this->address_country, 'address' => $this->address, 'zip' => $this->zip, 'place' => $this->place, '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(''), ], ]; } }