From a3029d475d280df9a649c88352089b1d63a5ebd5 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Sat, 27 Jun 2026 15:46:12 +0000 Subject: [PATCH] Use ladl.link URLs for all front-facing QR and short-link surfaces. Public landing pages, asset paths, payment callbacks, and redirects now go through QrCode::publicPath() / LadillLink instead of ladill.com/q/* routes. Co-authored-by: Cursor --- app/Http/Controllers/Public/BookingController.php | 15 +++++---------- app/Http/Controllers/Public/QrScanController.php | 4 ++-- .../Controllers/Public/SaleOrderController.php | 5 +++-- app/Services/Merchant/GiveDonationService.php | 2 +- resources/views/qr-codes/badges.blade.php | 2 +- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/app/Http/Controllers/Public/BookingController.php b/app/Http/Controllers/Public/BookingController.php index 533af45..0cba266 100644 --- a/app/Http/Controllers/Public/BookingController.php +++ b/app/Http/Controllers/Public/BookingController.php @@ -6,6 +6,7 @@ use App\Http\Controllers\Controller; use App\Models\QrCode; use App\Services\Merchant\BookingSlotService; use App\Services\Merchant\MerchantSaleService; +use App\Support\LadillLink; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; @@ -63,10 +64,7 @@ class BookingController extends Controller return response()->json([ 'confirmed' => true, - 'redirect_url' => route('qr.public.booking.confirmed', [ - 'shortCode' => $shortCode, - 'booking' => $result['booking']->id, - ]), + 'redirect_url' => LadillLink::path($shortCode, 'booking/confirmed/'.$result['booking']->id), ]); } @@ -74,19 +72,16 @@ class BookingController extends Controller { $reference = trim((string) $request->query('reference', '')); if ($reference === '') { - return redirect('/q/'.$shortCode)->with('error', 'Missing payment reference.'); + return redirect()->away(LadillLink::url($shortCode))->with('error', 'Missing payment reference.'); } try { $booking = $this->sales->completeBooking($reference); } catch (\Throwable) { - return redirect('/q/'.$shortCode)->with('order_error', 'Payment could not be verified. Reference: '.$reference); + return redirect()->away(LadillLink::url($shortCode))->with('order_error', 'Payment could not be verified. Reference: '.$reference); } - return redirect()->route('qr.public.booking.confirmed', [ - 'shortCode' => $shortCode, - 'booking' => $booking->id, - ]); + return redirect()->away(LadillLink::path($shortCode, 'booking/confirmed/'.$booking->id)); } public function confirmed(string $shortCode, int $booking): View diff --git a/app/Http/Controllers/Public/QrScanController.php b/app/Http/Controllers/Public/QrScanController.php index 58ea24d..d28befa 100644 --- a/app/Http/Controllers/Public/QrScanController.php +++ b/app/Http/Controllers/Public/QrScanController.php @@ -36,7 +36,7 @@ class QrScanController extends Controller } if ($qrCode->isDocumentType()) { - return redirect()->route('qr.public.view', $shortCode); + return redirect()->away($qrCode->publicPath('view')); } if ($qrCode->isBookingType()) { @@ -66,7 +66,7 @@ class QrScanController extends Controller return view('public.qr.document-viewer', [ 'qrCode' => $qrCode, - 'fileUrl' => route('qr.public.file', $shortCode), + 'fileUrl' => $qrCode->publicPath('file'), 'allowDownload' => (bool) ($qrCode->content()['allow_download'] ?? true), ]); } diff --git a/app/Http/Controllers/Public/SaleOrderController.php b/app/Http/Controllers/Public/SaleOrderController.php index fda2128..67c812c 100644 --- a/app/Http/Controllers/Public/SaleOrderController.php +++ b/app/Http/Controllers/Public/SaleOrderController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Public; use App\Http\Controllers\Controller; use App\Models\QrCode; use App\Services\Merchant\MerchantSaleService; +use App\Support\LadillLink; use App\Support\Qr\QrTypeCatalog; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; @@ -59,13 +60,13 @@ class SaleOrderController extends Controller { $reference = trim((string) $request->query('reference', '')); if ($reference === '') { - return redirect('/q/'.$shortCode)->with('error', 'Missing payment reference.'); + return redirect()->away(LadillLink::url($shortCode))->with('error', 'Missing payment reference.'); } try { $order = $this->sales->completeOrder($reference); } catch (\Throwable) { - return redirect('/q/'.$shortCode)->with('order_error', 'Payment could not be verified. Contact the merchant with reference: '.$reference); + return redirect()->away(LadillLink::url($shortCode))->with('order_error', 'Payment could not be verified. Contact the merchant with reference: '.$reference); } return view('public.qr.order-success', [ diff --git a/app/Services/Merchant/GiveDonationService.php b/app/Services/Merchant/GiveDonationService.php index dcfa53e..6d7c4c6 100644 --- a/app/Services/Merchant/GiveDonationService.php +++ b/app/Services/Merchant/GiveDonationService.php @@ -46,7 +46,7 @@ class MerchantSaleService $amountMinor = (int) round($amountGhs * 100); $reference = 'MCHT-'.strtoupper(Str::random(16)); $orgName = $qrCode->content()['name'] ?? $qrCode->label ?? 'Storefront'; - $callbackUrl = route('qr.public.order.callback', ['shortCode' => $qrCode->short_code]); + $callbackUrl = \App\Support\LadillLink::path($qrCode->short_code, 'order/callback'); $order = QrSaleOrder::create([ 'qr_code_id' => $qrCode->id, diff --git a/resources/views/qr-codes/badges.blade.php b/resources/views/qr-codes/badges.blade.php index b951707..bc18a42 100644 --- a/resources/views/qr-codes/badges.blade.php +++ b/resources/views/qr-codes/badges.blade.php @@ -3,7 +3,7 @@ $evColor = $c['brand_color'] ?? '#4f46e5'; $evName = $c['name'] ?? $qrCode->label; $hasLogo = !empty($c['logo_path']); - $logoUrl = $hasLogo ? route('qr.public.event.logo', $qrCode->short_code) : null; + $logoUrl = $hasLogo ? $qrCode->publicPath('event-logo') : null; $size = $c['badge_size'] ?? '4x3'; // Physical badge dimensions (inches) [$bw, $bh] = match ($size) {