diff --git a/app/Http/Controllers/Public/EventRegistrationController.php b/app/Http/Controllers/Public/EventRegistrationController.php index 1ae613e..2241583 100644 --- a/app/Http/Controllers/Public/EventRegistrationController.php +++ b/app/Http/Controllers/Public/EventRegistrationController.php @@ -29,8 +29,8 @@ class EventRegistrationController extends Controller 'tier' => ['required', 'string', 'max:80'], 'amount' => ['nullable', 'numeric', 'min:1', 'max:1000000'], 'attendee_name' => ['required', 'string', 'max:120'], - 'attendee_email' => ['required', 'email', 'max:200'], - 'attendee_phone' => ['nullable', 'string', 'max:30'], + 'attendee_email' => ['nullable', 'email', 'max:200'], + 'attendee_phone' => ['required', 'string', 'max:30'], 'badge_fields' => ['nullable', 'array'], ]); diff --git a/resources/views/public/qr/event-confirmed.blade.php b/resources/views/public/qr/event-confirmed.blade.php index 222b28b..51242e5 100644 --- a/resources/views/public/qr/event-confirmed.blade.php +++ b/resources/views/public/qr/event-confirmed.blade.php @@ -44,7 +44,9 @@ @endif + @if($registration->attendee_email)

A receipt was sent to {{ $registration->attendee_email }}.

+ @endif @else

Hi {{ $registration->attendee_name }}, your spot is confirmed.

@@ -64,7 +66,11 @@ @endforeach + @if($registration->attendee_email)

Show this badge code at check-in. A confirmation was sent to {{ $registration->attendee_email }}.

+ @else +

Show this badge code at check-in.

+ @endif @endif diff --git a/resources/views/public/qr/landing.blade.php b/resources/views/public/qr/landing.blade.php index a7a9d74..493ae11 100644 --- a/resources/views/public/qr/landing.blade.php +++ b/resources/views/public/qr/landing.blade.php @@ -3,8 +3,8 @@ - @include('partials.favicon') {{ $qrCode->label }} + @include('partials.favicon') @vite(['resources/css/app.css']) @@ -24,7 +24,7 @@ - @@ -32,7 +32,7 @@ View document - @@ -62,7 +62,7 @@ {{-- ===== VCARD ===== --}} @elseif($type === \App\Models\QrCode::TYPE_VCARD) @php - $avatarUrl = !empty($content['avatar_path']) ? route('qr.public.vcard.avatar', $qrCode->short_code) : null; + $avatarUrl = !empty($content['avatar_path']) ? $qrCode->publicPath('avatar') : null; $rawSocial = $content['social'] ?? []; $social = []; foreach ($rawSocial as $platform => $url) { @@ -159,7 +159,7 @@ {{-- Save contact button --}}
- Save Contact @@ -178,8 +178,8 @@ $bizColor = $content['brand_color'] ?? '#1e3a5f'; $bizHasLogo = !empty($content['logo_path']); $bizHasCover = !empty($content['cover_path']); - $bizLogoUrl = $bizHasLogo ? route('qr.public.business.logo', $qrCode->short_code) : null; - $bizCoverUrl = $bizHasCover ? route('qr.public.business.cover', $qrCode->short_code) : null; + $bizLogoUrl = $bizHasLogo ? $qrCode->publicPath('business-logo') : null; + $bizCoverUrl = $bizHasCover ? $qrCode->publicPath('business-cover') : null; $bizInitials = strtoupper(substr($bizName, 0, 1)); $bizRawSocial = $content['social'] ?? []; $bizSocial = []; @@ -313,8 +313,8 @@ $churchColor = $content['brand_color'] ?? '#1a3a5c'; $churchHasLogo = !empty($content['logo_path']); $churchHasCover = !empty($content['cover_path']); - $churchLogoUrl = $churchHasLogo ? route('qr.public.church.logo', $qrCode->short_code) : null; - $churchCoverUrl = $churchHasCover ? route('qr.public.church.cover', $qrCode->short_code) : null; + $churchLogoUrl = $churchHasLogo ? $qrCode->publicPath('church-logo') : null; + $churchCoverUrl = $churchHasCover ? $qrCode->publicPath('church-cover') : null; $churchInitials = strtoupper(substr($churchName, 0, 2)); $churchAcceptsPay = !empty($content['accepts_payment']); $churchCurrency = $content['currency'] ?? 'GHS'; @@ -325,7 +325,7 @@ $churchTypes, array_map(fn($t) => $legacyLabels[strtolower(trim($t))] ?? trim($t), $churchTypes) ); - $churchOrderRoute = route('qr.public.order', $qrCode->short_code); + $churchOrderRoute = $qrCode->publicPath('order'); $churchCsrf = csrf_token(); @endphp
- @@ -631,8 +627,8 @@ $evColor = $content['brand_color'] ?? '#4f46e5'; $evHasLogo = !empty($content['logo_path']); $evHasCover = !empty($content['cover_path']); - $evLogoUrl = $evHasLogo ? route('qr.public.event.logo', $qrCode->short_code) : null; - $evCoverUrl = $evHasCover ? route('qr.public.event.cover', $qrCode->short_code) : null; + $evLogoUrl = $evHasLogo ? $qrCode->publicPath('event-logo') : null; + $evCoverUrl = $evHasCover ? $qrCode->publicPath('event-cover') : null; $evName = $content['name'] ?? $qrCode->label; $evInitials = strtoupper(mb_substr($evName, 0, 2)); $evTiers = $content['tiers'] ?? []; @@ -642,7 +638,7 @@ $evMode = in_array($content['mode'] ?? 'ticketing', ['contributions', 'free'], true) ? ($content['mode'] ?? 'ticketing') : 'ticketing'; $evCategories = $content['contribution_categories'] ?? ['Contribution']; $evHeading = $evMode === 'contributions' ? 'Make a contribution' : 'Register'; - $evRegRoute = route('qr.public.event.register', $qrCode->short_code); + $evRegRoute = $qrCode->publicPath('register'); $evCsrf = csrf_token(); @endphp
Your details

- - @foreach($evFields as $field) short_code) : null; + $itinCoverUrl = $itinHasCover ? $qrCode->publicPath('itinerary-cover') : null; $itinTitle = $content['title'] ?? $qrCode->label; $itinDays = $content['days'] ?? []; $multiDay = count($itinDays) > 1; @@ -1029,7 +1023,7 @@

{{ $qrCode->label }}

@foreach($content['images'] ?? [] as $index => $image) - {{ $image['title'] ?? 'Image ' . ($index + 1) }} @@ -1039,7 +1033,7 @@ {{-- ===== APP ===== --}} @elseif($type === \App\Models\QrCode::TYPE_APP) -@php $appIconUrl = !empty($content['icon_path']) ? route('qr.public.app.icon', $qrCode->short_code) : null; @endphp +@php $appIconUrl = !empty($content['icon_path']) ? $qrCode->publicPath('app-icon') : null; @endphp
@if($appIconUrl) @@ -1132,14 +1126,14 @@ $sections = $content['sections'] ?? []; $title = $content['title'] ?? $qrCode->label; $acceptsPayment = (bool) ($content['accepts_payment'] ?? false); - $orderRoute = route('qr.public.order', $qrCode->short_code); + $orderRoute = $qrCode->publicPath('order'); $csrfToken = csrf_token(); $paystackPublicKey = $acceptsPayment ? app(\App\Services\Billing\PaystackService::class)->publicKey() : ''; $brandColor = $content['brand_color'] ?? ($isShop ? '#7c3aed' : '#f97316'); $hasLogo = !empty($content['logo_path']); $hasCover = !empty($content['cover_path']); - $logoUrl = $hasLogo ? route('qr.public.menu.logo', $qrCode->short_code) : null; - $coverUrl = $hasCover ? route('qr.public.menu.cover', $qrCode->short_code) : null; + $logoUrl = $hasLogo ? $qrCode->publicPath('menu-logo') : null; + $coverUrl = $hasCover ? $qrCode->publicPath('menu-cover') : null; $shippingType = $content['shipping_type'] ?? 'none'; $shippingFee = (float) ($content['shipping_fee'] ?? 0); $freeShippingAbove = (float) ($content['free_shipping_above'] ?? 0); @@ -1186,7 +1180,6 @@ async submitOrder() { if (this.cartCount === 0) { this.errorMsg = 'Add at least one item.'; return } if (!this.name.trim()) { this.errorMsg = 'Enter your name.'; return } - if (!this.email.trim() || !this.email.includes('@')) { this.errorMsg = 'Enter a valid email address.'; return } if (!this.phone.trim()) { this.errorMsg = 'Enter your phone number.'; return } this.errorMsg = ''; this.loading = true; @@ -1291,7 +1284,7 @@
{{-- Item image --}} @if($hasImage) - {{ $item['name'] }} @endif @@ -1451,8 +1444,6 @@

Your details

-