*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'date' => $this->date->timestamp, 'date_format' => $this->date->format('Y-m-d H:i'), 'employee_id' => $this->employee_id, 'employee' => EmployeeResource::make($this->whenLoaded('employee')), 'store_id' => $this->store_id, 'store' => StoreResource::make($this->whenLoaded('store')), 'reason' => $this->reason, 'sign_time' => $this->sign_time, 'sign_time_text' => $this->sign_time->text(), 'sign_type' => $this->sign_type, 'outside_remarks' => $this->outside_remarks, 'created_at' => $this->created_at->timestamp, 'created_format' => $this->created_at->format('Y-m-d H:i:s'), 'workflow_check' => WorkflowCheckResource::make($this->whenLoaded('workflow')), ]; } }