*/ public function toArray(Request $request): array { return [ 'name' => $this->name, 'email' => $this->email, 'emailVerified' => $this->hasVerifiedEmail(), 'emailVerifiedAt' => $this->email_verified_at?->toISOString(), 'height' => $this->height, 'avatarUrl' => $this->avatar_url ? asset(Storage::url($this->avatar_url)) : null, 'bio' => $this->bio, 'accountVerified' => $this->account_verified_at !== null, 'physicalActivityLevel' => $this->physical_activity_level, 'weightGoal' => $this->weight_goal, 'pacePreference' => $this->pace_preference, 'sex' => $this->sex, 'dateOfBirth' => $this->date_of_birth?->toDateString(), 'nutritionGoals' => [ 'calories' => (int) $this->daily_calorie_goal, 'proteins' => (float) $this->daily_protein_goal, 'carbs' => (float) $this->daily_carbs_goal, 'fats' => (float) $this->daily_fats_goal, ], ]; } }