*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'examination_id' => $this->examination_id, 'examination' => TrainExaminationResource::make($this->whenLoaded('examination')), 'employee_id' => $this->employee_id, 'employee' => EmployeeResource::make($this->whenLoaded('employee')), 'content' => $this->content, 'mark' => $this->mark, 'finished_at' => $this->finished_at?->timestamp, ]; } }