feat: event registration branding with vertical wizard layout

- Add registration_banner_url, registration_welcome_text, registration_logo_url
  columns to events table with migration
- Add uploadImage endpoint (POST .../upload-image) with form request validation
  for banner and logo images (jpg/png/webp, max 5MB)
- Include branding fields in EventResource and PublicRegistrationDataController
- Build registration settings UI in organizer event settings page with
  banner/logo upload and welcome text editor
- Redesign portal registration page: hero banner with gradient overlay,
  welcome text card, vertical step navigation (desktop) / horizontal chips
  (mobile), two-column form fields with density="comfortable"
- Update success page with event banner and consistent branding
- Seed welcome text for Echt Feesten 2026
- Add 9 PHPUnit tests covering image upload, branding fields in API responses

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 21:09:49 +02:00
parent 78cc19373e
commit 0d741550a8
16 changed files with 1225 additions and 672 deletions

View File

@@ -7,6 +7,7 @@ namespace App\Http\Controllers\Api\V1;
use App\Http\Controllers\Controller;
use App\Http\Requests\Api\V1\StoreEventRequest;
use App\Http\Requests\Api\V1\UpdateEventRequest;
use App\Http\Requests\Api\V1\UploadEventImageRequest;
use App\Http\Resources\Api\V1\EventResource;
use App\Models\Event;
use App\Models\Organisation;
@@ -15,6 +16,7 @@ use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Storage;
final class EventController extends Controller
{
@@ -126,6 +128,24 @@ final class EventController extends Controller
return EventResource::collection($children);
}
public function uploadImage(UploadEventImageRequest $request, Organisation $organisation, Event $event): JsonResponse
{
Gate::authorize('update', [$event, $organisation]);
$path = $request->file('image')->store(
"events/{$event->id}",
'public'
);
$field = $request->type === 'banner'
? 'registration_banner_url'
: 'registration_logo_url';
$event->update([$field => Storage::disk('public')->url($path)]);
return response()->json(['url' => $event->fresh()->{$field}]);
}
public function stats(Event $event): JsonResponse
{
Gate::authorize('view', $event);

View File

@@ -60,6 +60,9 @@ final class PublicRegistrationDataController extends Controller
'start_date' => $festivalEvent->start_date->toDateString(),
'end_date' => $festivalEvent->end_date->toDateString(),
'organisation_id' => $festivalEvent->organisation_id,
'registration_banner_url' => $festivalEvent->registration_banner_url,
'registration_welcome_text' => $festivalEvent->registration_welcome_text,
'registration_logo_url' => $festivalEvent->registration_logo_url,
],
'sections' => $sections->map(fn (FestivalSection $section) => [
'id' => $section->id,

View File

@@ -27,6 +27,7 @@ final class UpdateEventRequest extends FormRequest
'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'],
];
}
}

View File

@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\Api\V1;
use Illuminate\Foundation\Http\FormRequest;
final class UploadEventImageRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/** @return array<string, mixed> */
public function rules(): array
{
return [
'image' => ['required', 'image', 'mimes:jpg,jpeg,png,webp', 'max:5120'],
'type' => ['required', 'in:banner,logo'],
];
}
}

View File

@@ -27,6 +27,9 @@ final class EventResource extends JsonResource
'event_type_label' => $this->event_type_label,
'sub_event_label' => $this->sub_event_label,
'is_recurring' => $this->is_recurring,
'registration_banner_url' => $this->registration_banner_url,
'registration_welcome_text' => $this->registration_welcome_text,
'registration_logo_url' => $this->registration_logo_url,
'is_festival' => $this->resource->isFestival(),
'is_sub_event' => $this->resource->isSubEvent(),
'is_flat_event' => $this->resource->isFlatEvent(),