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(), 'asset_type_id' => $this->asset_type_id, 'approved_jobs_id' => $this->approved_jobs_id, 'user_id' => $this->user_id, 'name' => $this->name, 'group_m' => $this->group_m, 'description' => $this->description, 'id_number' => $this->id_number, 'qty' => $this->qty, 'qty_type_m' => $this->qty_type_m, 'purchase_date' => $this->purchase_date, 'age' => $this->age, 'book_replacement_date' => $this->book_replacement_date, 'book_remaining_life' => $this->book_remaining_life, 'total_replacement_cost' => $this->total_replacement_cost, 'asset_category_m' => $this->asset_category_m, 'replace_refurbish_m' => $this->replace_refurbish_m, 'funding_source' => $this->funding_source, 'images' => $this->images, 'assetid2' => $this->assetid2, 'comment' => $this->comment, '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; } }