*/ final class ScreeningFactory extends Factory { protected $model = Screening::class; /** * Define the model's default state. */ public function definition(): array { return [ 'user_id' => User::factory(), 'score' => null, 'passed' => null, ]; } /** * Indicate that the screening passed. */ public function passed(): static { return $this->state(fn (array $attributes) => [ 'score' => 10, 'passed' => true, ]); } /** * Indicate that the screening failed. */ public function failed(): static { return $this->state(fn (array $attributes) => [ 'score' => 3, 'passed' => false, ]); } }