*/ class BugFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ protected $model = Bug::class; /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'titulo' => $this->faker->sentence(4), 'descripcion' => $this->faker->paragraph(), 'prioridad' => $this->faker->randomElement(['baja', 'media', 'alta']), 'estado' => $this->faker->randomElement(['abierto', 'en progreso', 'cerrado']), 'version' => $this->faker->regexify('[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}'), 'fotobug_id' => $this->faker->optional()->then(fn () => FotoBug::factory()), ]; } }