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(), 'user_id' => $this->user_id, 'name' => $this->name, 'book_expected_life' => $this->book_expected_life, 'replacement_unit_cost' => $this->replacement_unit_cost, 'qty_type_m' => $this->qty_type_m, 'expected_life_source' => $this->expected_life_source, 'removal_cost' => $this->removal_cost, 'removal_unit_cost_source' => $this->removal_unit_cost_source, 'supply_install_cost' => $this->supply_install_cost, 'design_fees' => $this->design_fees, 'contingency' => $this->contingency, 'model' => $this->model, 'system' => $this->system, 'images' => $this->images, 'user_type' => $this->user_type, '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(''), ], ]; } /** * 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(), ], ]; } private function workflows() { $arr = []; return $arr; } private function actions() { $arr = []; return $arr; } }