progress
This commit is contained in:
@@ -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')),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user