*/ class EntryFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { $student = Student::factory()->create(); $audition = Audition::factory()->create(); return [ 'student_id' => $student->id, 'audition_id' => $audition->id, 'draw_number' => null, 'for_seating' => 1, 'for_advancement' => 1, ]; } public function seatingOnly(): self { return $this->state( fn (array $attributes) => ['for_advancement' => 0] ); } public function advanceOnly(): self { return $this->state( fn (array $attributes) => ['for_seating' => 0] ); } }