- Update API: events, users, policies, routes, resources, migrations - Remove deprecated models/resources (customers, setlists, invitations, etc.) - Refresh admin app and docs; remove apps/band Made-with: Cursor
36 lines
974 B
PHP
36 lines
974 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Event;
|
|
use App\Models\Organisation;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/** @extends Factory<Event> */
|
|
final class EventFactory extends Factory
|
|
{
|
|
/** @return array<string, mixed> */
|
|
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']);
|
|
}
|
|
}
|