|
|
@@ -38,14 +38,13 @@ class UserResource extends JsonResource
|
|
|
? Storage::disk('s3')->temporaryUrl($this->photo_path, now()->addHours(24))
|
|
|
: null,
|
|
|
|
|
|
- 'dependents' => $this->whenLoaded('dependents', function () {
|
|
|
- return $this->dependents->map(function ($dependent) {
|
|
|
- return [
|
|
|
- 'name' => $dependent->name,
|
|
|
- 'kinship' => $dependent->kinship,
|
|
|
- ];
|
|
|
- })->values();
|
|
|
- }),
|
|
|
+ 'dependents' => $this->dependents->map(fn($dependent) => [
|
|
|
+ 'id' => $dependent->id,
|
|
|
+ 'name' => $dependent->name,
|
|
|
+ 'kinship' => $dependent->kinship,
|
|
|
+ 'status' => $dependent->status,
|
|
|
+ 'expiry_date' => $this->expiry_date?->format('d/m/Y'),
|
|
|
+ ]),
|
|
|
'first_access_completed_at' => $this->first_access_completed_at?->format('Y-m-d H:i:s'),
|
|
|
'terms_accepted_at' => $this->terms_accepted_at?->format('Y-m-d H:i:s'),
|
|
|
'on_leave_at' => $this->on_leave_at?->format('Y-m-d H:i:s'),
|