This commit is contained in:
2026-08-10 19:18:25 +03:00
parent a9923f72ce
commit 7c501d1e9f
35 changed files with 2185 additions and 78 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class UserResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'email' => $this->email,
'is_trainer' => (bool) $this->is_trainer,
'is_admin' => (bool) $this->is_admin,
'age' => $this->age,
'weight_kg' => $this->weight_kg !== null ? (float) $this->weight_kg : null,
'height_cm' => $this->height_cm !== null ? (float) $this->height_cm : null,
'fitness_level' => $this->fitness_level,
'goal' => $this->goal,
'health_notes' => $this->health_notes,
'available_equipment' => $this->available_equipment,
'days_per_week' => $this->days_per_week,
'minutes_per_session' => $this->minutes_per_session,
'created_at' => $this->created_at,
];
}
}