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
@@ -0,0 +1,24 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class WorkoutExerciseResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'workout_id' => $this->workout_id,
'position' => $this->position,
'sets' => $this->sets,
'reps' => $this->reps,
'weight' => $this->weight !== null ? (float) $this->weight : null,
'rest_seconds' => $this->rest_seconds,
'notes' => $this->notes,
'exercise' => new ExerciseResource($this->whenLoaded('exercise')),
];
}
}