|
|
@@ -40,6 +40,10 @@ public function toArray(Request $request): array
|
|
|
'payment_method' => $this->payment_method,
|
|
|
'fine_cancelled' => $this->fine_cancelled,
|
|
|
'status' => $this->status,
|
|
|
+ 'student_name' => $this->whenLoaded('student', fn () => $this->student->name),
|
|
|
+ 'student_phone' => $this->whenLoaded('student', fn () => $this->student->phone),
|
|
|
+ 'student_city' => $this->whenLoaded('student', fn () => $this->student->city?->name),
|
|
|
+ 'student_state_code' => $this->whenLoaded('student', fn () => $this->student->state?->code),
|
|
|
'file_url' => $this->file_url ? Storage::url($this->file_url) : null,
|
|
|
'file_type' => $this->file_type,
|
|
|
'created_at' => Carbon::parse($this->created_at)->format('Y-m-d H:i:s'),
|