*/ class DisplayFactory extends Factory { /** * The name of the factory's corresponding model. * * @var class-string */ protected $model = Display::class; /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'name' => fake()->words(2, true), 'location' => fake()->optional()->words(3, true), 'is_active' => true, 'is_test' => false, 'preview_token' => null, ]; } public function test(): static { return $this->state(fn () => [ 'is_test' => true, 'name' => 'Test-Display', 'location' => 'Vorschau / Test', ]); } }