33 lines
1.0 KiB
PHP
33 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\Api\V1;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
final class UpdateEventRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/** @return array<string, mixed> */
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
// Status changes must go through POST /events/{event}/transition
|
|
'name' => ['sometimes', 'string', 'max:255'],
|
|
'slug' => ['sometimes', 'string', 'max:255', 'regex:/^[a-z0-9-]+$/'],
|
|
'start_date' => ['sometimes', 'date'],
|
|
'end_date' => ['sometimes', 'date', 'after_or_equal:start_date'],
|
|
'timezone' => ['sometimes', 'string', 'max:50'],
|
|
'parent_event_id' => ['nullable', 'ulid', 'exists:events,id'],
|
|
'event_type' => ['sometimes', 'in:event,festival,series'],
|
|
'event_type_label' => ['nullable', 'string', 'max:50'],
|
|
'sub_event_label' => ['nullable', 'string', 'max:50'],
|
|
];
|
|
}
|
|
}
|