*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'month' => $this->month, 'store_id' => $this->store_id, 'store' => StoreResource::make($this->whenLoaded('store')), 'description' => $this->description, 'photos' => $this->photos, 'status' => $this->task_status, 'status_text' => $this->task_status->text(), 'created_at' => $this->created_at->timestamp, 'created_format' => $this->created_at->format('Y-m-d'), 'store_master_id' => $this->store_master_id, 'store_master' => EmployeeResource::make($this->whenLoaded('storeMaster')), 'workflow_check' => WorkflowCheckResource::make($this->whenLoaded('workflow')), 'task' => TaskResource::make($this->whenLoaded('task')), ]; } }