$this->id, 'user_id' => $this->user_id, 'profile_id' => $this->profile_id, 'effective_date' => $this->effective_date?->toDateString(), 'expiry_date' => $this->expiry_date?->toDateString(), 'created_at' => $this->created_at?->toISOString(), 'user' => $this->whenLoaded('user', fn () => [ 'id' => $this->user->id, 'name' => $this->user->name, 'email' => $this->user->email, 'ic_number' => $this->user->ic_number, ]), 'profile' => $this->whenLoaded('profile', fn () => [ 'id' => $this->profile->id, 'name' => $this->profile->name, 'description' => $this->profile->description, ]), ]; } }