*/ final class EventFactory extends Factory { /** @return array */ public function definition(): array { $city = fake('nl_NL')->city(); $year = fake()->year('+2 years'); $name = "Festival {$city} {$year}"; $startDate = fake()->dateTimeBetween('+1 month', '+6 months'); return [ 'organisation_id' => Organisation::factory(), 'name' => $name, 'slug' => str($name)->slug()->toString(), 'start_date' => $startDate, 'end_date' => fake()->dateTimeBetween($startDate, (clone $startDate)->modify('+3 days')), 'timezone' => 'Europe/Amsterdam', 'status' => 'draft', ]; } public function published(): static { return $this->state(fn () => ['status' => 'published']); } }