Fix audition factory to only create event if one is not provided.

This commit is contained in:
Matt Young 2025-07-01 09:59:10 -05:00
parent 42894c40c1
commit b4bf94d9f8
1 changed files with 4 additions and 5 deletions

View File

@ -37,11 +37,9 @@ class AuditionFactory extends Factory
'Percussion',
];
$event = Event::factory()->create();
return [
'event_id' => $event->id,
#'name' => $this->faker->randomElement($instruments).$this->faker->numberBetween(1, 1000),
'event_id' => Event::factory(),
//'name' => $this->faker->randomElement($instruments).$this->faker->numberBetween(1, 1000),
'name' => 'New Instrument '.$this->faker->unique()->words(4, true),
'score_order' => $this->faker->numberBetween(2, 50),
'entry_deadline' => Carbon::tomorrow(),
@ -62,6 +60,7 @@ class AuditionFactory extends Factory
fn (array $attributes) => ['entry_deadline' => $entryDeadline ?? Carbon::yesterday()]
);
}
public function seatingOnly(): self
{
return $this->state(