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, 'participant_id' => $this->participant_id, 'developer_id' => $this->developer_id, 'developer_number' => $this->developer_number, 'developer_name_ar' => $this->developer_name_ar, 'developer_name_en' => $this->developer_name_en, 'registration_date' => $this->registration_date, 'license_source_id' => $this->license_source_id, 'license_source_ar' => $this->license_source_ar, 'license_source_en' => $this->license_source_en, 'license_type_id' => $this->license_type_id, 'license_type_ar' => $this->license_type_ar, 'license_type_en' => $this->license_type_en, 'legal_status' => $this->legal_status, 'legal_status_ar' => $this->legal_status_ar, 'legal_status_en' => $this->legal_status_en, 'webpage' => $this->webpage, 'phone' => $this->phone, 'fax' => $this->fax, 'license_number' => $this->license_number, 'license_issue_date' => $this->license_issue_date, 'license_expiry_date' => $this->license_expiry_date, 'chamber_of_commerce_no' => $this->chamber_of_commerce_no, '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; } }