Build & Deploy / build (push) Successful in 18s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Functional\Routines\Database\Factories;
|
|
|
|
use Functional\Exercises\Models\Exercise;
|
|
use Functional\Routines\Models\Routine;
|
|
use Functional\Routines\Models\RoutineExercise;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<RoutineExercise>
|
|
*/
|
|
class RoutineExerciseFactory extends Factory
|
|
{
|
|
protected $model = RoutineExercise::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'routine_id' => Routine::factory(),
|
|
'exercise_id' => Exercise::factory(),
|
|
'position' => fake()->numberBetween(1, 10),
|
|
'sets' => fake()->numberBetween(3, 5),
|
|
'target_reps' => fake()->randomElement(['6-8', '8-12', '10-15', '12-20', 'AMRAP']),
|
|
'rest_seconds' => fake()->optional(0.8)->randomElement([45, 60, 90, 120, 180]),
|
|
'tempo' => fake()->optional(0.4)->randomElement(['2-0-2', '3-1-1', '4-0-1']),
|
|
'target_weight' => fake()->optional(0.6)->randomFloat(2, 10, 120),
|
|
'notes' => fake()->optional(0.3)->sentence(8),
|
|
];
|
|
}
|
|
}
|