*/ class HubFactory extends Factory { protected $model = Hub::class; public function definition(): array { $name = fake()->city().' '.fake()->randomElement(['Region', 'Hub', 'Gebiet']); return [ 'name' => $name, 'slug' => Str::slug($name).'-'.fake()->unique()->numberBetween(100, 999), 'is_active' => true, ]; } /** * Inaktiver Hub. */ public function inactive(): static { return $this->state(fn (array $attributes) => [ 'is_active' => false, ]); } }