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(), 'slug' => $this->slug, 'property_id' => $this->property_id, 'area_id' => $this->area_id, 'zone_id' => $this->zone_id, 'area_name_ar' => $this->area_name_ar, 'area_name_en' => $this->area_name_en, 'land_number' => $this->land_number, 'land_sub_number' => $this->land_sub_number, 'building_number' => $this->building_number, 'common_area' => $this->common_area, 'actual_common_area' => $this->actual_common_area, 'floors' => $this->floors, 'rooms' => $this->rooms, 'rooms_ar' => $this->rooms_ar, 'rooms_en' => $this->rooms_en, 'car_parks' => $this->car_parks, 'built_up_area' => $this->built_up_area, 'bld_levels' => $this->bld_levels, 'shops' => $this->shops, 'flats' => $this->flats, 'offices' => $this->offices, 'swimming' => $this->swimming, 'elevators' => $this->elevators, 'actual_area' => $this->actual_area, 'property_type_id' => $this->property_type_id, 'property_type_ar' => $this->property_type_ar, 'property_type_en' => $this->property_type_en, 'property_sub_type_id' => $this->property_sub_type_id, 'property_sub_type_ar' => $this->property_sub_type_ar, 'property_sub_type_en' => $this->property_sub_type_en, 'parent_property_id' => $this->parent_property_id, 'creation_date' => $this->creation_date, 'parcel_id' => $this->parcel_id, 'is_free_hold' => $this->is_free_hold, 'is_lease_hold' => $this->is_lease_hold, 'is_registered' => $this->is_registered, 'pre_registration_number' => $this->pre_registration_number, 'master_project_id' => $this->master_project_id, 'master_project_en' => $this->master_project_en, 'master_project_ar' => $this->master_project_ar, 'project_id' => $this->project_id, 'project_name_ar' => $this->project_name_ar, 'project_name_en' => $this->project_name_en, 'land_type_id' => $this->land_type_id, 'land_type_ar' => $this->land_type_ar, 'land_type_en' => $this->land_type_en, '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(''), 'workflow' => $this->workflows(), 'actions' => $this->actions(), ], ]; } /** * Get additional data that should be returned with the resource array. * * @param \Illuminate\Http\Request $request * @return array */ public function with($request) { return [ 'meta' => [ 'exists' => $this->exists(), 'link' => $this->itemLink(), 'upload_url' => $this->getUploadURL(''), 'workflow' => $this->workflows(), 'actions' => $this->actions(), ], ]; } /** * Get the workflows for the resource. * * @return array */ private function workflows() { $arr = []; return $arr; } /** * Get the actions for the resource. * * @return array */ private function actions() { $arr = []; return $arr; } }