Files
crewli/api/app/Http/Requests/Api/V1/UpdateEventRequest.php
bert.hausmans ef7c482b4a fix: allow registration_banner_url and registration_logo_url on event update
Missing from UpdateEventRequest rules, so the fields were stripped from
validated() and the uploaded URLs never persisted — the preview showed
briefly in the upload component but disappeared on reload because the
event record still had null.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-16 20:42:25 +02:00

39 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Http\Requests\Api\V1;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
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', Rule::exists('events', 'id')->where('organisation_id', $this->route('organisation')->id)],
'event_type' => ['sometimes', 'in:event,festival,series'],
'event_type_label' => ['nullable', 'string', 'max:50'],
'sub_event_label' => ['nullable', 'string', 'max:50'],
'registration_welcome_text' => ['nullable', 'string', 'max:1000'],
'registration_banner_url' => ['nullable', 'string', 'max:2048'],
'registration_logo_url' => ['nullable', 'string', 'max:2048'],
'registration_show_section_preferences' => ['nullable', 'boolean'],
'registration_show_availability' => ['nullable', 'boolean'],
];
}
}