Build & Deploy / build (push) Successful in 18s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
40 lines
1.5 KiB
PHP
40 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace Functional\Exercises\Database\Factories;
|
|
|
|
use Functional\Exercises\Models\Exercise;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<Exercise>
|
|
*/
|
|
class ExerciseFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$name = fake()->unique()->words(3, true);
|
|
$ext = fake()->unique()->numerify('####');
|
|
|
|
return [
|
|
'external_id' => $ext,
|
|
'name' => $name,
|
|
'slug' => \Illuminate\Support\Str::slug($name . '-' . $ext),
|
|
'category' => fake()->randomElement(['waist', 'chest', 'back', 'upper legs', 'shoulders']),
|
|
'body_part' => fake()->randomElement(['waist', 'chest', 'back', 'upper legs', 'shoulders']),
|
|
'equipment' => fake()->randomElement(['body weight', 'dumbbell', 'barbell', 'cable', 'kettlebell']),
|
|
'target' => fake()->randomElement(['abs', 'pectorals', 'lats', 'quads', 'delts']),
|
|
'muscle_group' => fake()->word(),
|
|
'secondary_muscles' => fake()->randomElements(['hip flexors', 'lower back', 'triceps', 'glutes'], 2),
|
|
'instructions' => ['en' => [fake()->sentence()], 'fr' => [fake()->sentence()]],
|
|
'image_path' => 'exercises/' . $ext . '.jpg',
|
|
'gif_path' => 'exercises/' . $ext . '.gif',
|
|
'attribution' => '© Gym visual — https://gymvisual.com/',
|
|
];
|
|
}
|
|
}
|