*/ final class EventFactory extends Factory { /** @return array */ public function definition(): array { $name = fake()->unique()->words(3, true); $startDate = fake()->dateTimeBetween('+1 week', '+3 months'); return [ 'organisation_id' => Organisation::factory(), 'name' => ucfirst($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']); } }