From 2991d71ea0d4b33c70a1664f1aa95c3089f02367 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Sat, 27 Jun 2026 16:06:32 +0000 Subject: [PATCH] Fix remaining merchant surfaces still using merchant.ladill.com/q URLs. Storefront QR cards, slug preview, payment callbacks, and document downloads now use LadillLink so displayed and encoded links match ladl.link. Co-authored-by: Cursor --- .env.example | 2 ++ app/Http/Controllers/Qr/QrCodeController.php | 2 +- app/Services/Merchant/MerchantSaleService.php | 5 +++-- config/link.php | 5 +++++ resources/views/merchant/storefronts/index.blade.php | 2 +- resources/views/merchant/storefronts/show.blade.php | 2 +- resources/views/public/qr/document-viewer.blade.php | 2 +- resources/views/qr-codes/create.blade.php | 4 ++-- 8 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 config/link.php diff --git a/.env.example b/.env.example index 979d698..f7f88c5 100644 --- a/.env.example +++ b/.env.example @@ -46,4 +46,6 @@ AFIA_PROVIDER=openai AFIA_MODEL=gpt-4o-mini AFIA_API_KEY= +LINK_PUBLIC_DOMAIN=ladl.link + VITE_APP_NAME="${APP_NAME}" diff --git a/app/Http/Controllers/Qr/QrCodeController.php b/app/Http/Controllers/Qr/QrCodeController.php index 22d5d58..c9f2f55 100644 --- a/app/Http/Controllers/Qr/QrCodeController.php +++ b/app/Http/Controllers/Qr/QrCodeController.php @@ -312,7 +312,7 @@ class QrCodeController extends Controller } } - $png = $this->imageGenerator->renderPng(QrCode::publicBaseUrl() . '/q/' . $shortCode, $style); + $png = $this->imageGenerator->renderPng(\App\Support\LadillLink::url($shortCode), $style); if ($tempLogoPath) { Storage::disk('qr')->delete($tempLogoPath); diff --git a/app/Services/Merchant/MerchantSaleService.php b/app/Services/Merchant/MerchantSaleService.php index cf1b406..216b2a8 100644 --- a/app/Services/Merchant/MerchantSaleService.php +++ b/app/Services/Merchant/MerchantSaleService.php @@ -10,6 +10,7 @@ use App\Services\Billing\BillingClient; use App\Services\Billing\PaystackService; use App\Services\Billing\SmsService; use App\Services\Pay\PayClient; +use App\Support\LadillLink; use App\Support\Qr\QrTypeCatalog; use RuntimeException; @@ -50,7 +51,7 @@ class MerchantSaleService $qrCode->loadMissing('user'); $customerEmail = trim((string) ($data['customer_email'] ?? '')); - $callbackUrl = route('qr.public.order.callback', ['shortCode' => $qrCode->short_code]); + $callbackUrl = LadillLink::path($qrCode->short_code, 'order/callback'); $payOrder = $this->pay->createCheckout([ 'merchant' => $qrCode->user->public_id, @@ -122,7 +123,7 @@ class MerchantSaleService $qrCode->loadMissing('user'); $customerEmail = trim((string) ($data['customer_email'] ?? '')); - $callbackUrl = route('qr.public.booking.callback', ['shortCode' => $qrCode->short_code]); + $callbackUrl = LadillLink::path($qrCode->short_code, 'booking/callback'); $booking = QrBooking::create([ 'qr_code_id' => $qrCode->id, diff --git a/config/link.php b/config/link.php new file mode 100644 index 0000000..87997eb --- /dev/null +++ b/config/link.php @@ -0,0 +1,5 @@ + env('LINK_PUBLIC_DOMAIN', 'ladl.link'), +]; diff --git a/resources/views/merchant/storefronts/index.blade.php b/resources/views/merchant/storefronts/index.blade.php index 8096d46..acfb1cc 100644 --- a/resources/views/merchant/storefronts/index.blade.php +++ b/resources/views/merchant/storefronts/index.blade.php @@ -24,7 +24,7 @@

{{ $qr->label }}

{{ $qr->content()['name'] ?? 'Organisation' }}

-

{{ $qr->is_active ? 'Active' : 'Inactive' }} · /q/{{ $qr->short_code }}

+

{{ $qr->is_active ? 'Active' : 'Inactive' }} · {{ $qr->publicUrl() }}

diff --git a/resources/views/merchant/storefronts/show.blade.php b/resources/views/merchant/storefronts/show.blade.php index 8632beb..833e759 100644 --- a/resources/views/merchant/storefronts/show.blade.php +++ b/resources/views/merchant/storefronts/show.blade.php @@ -2,7 +2,7 @@ {{ $qrCode->label }} @php $content = $qrCode->content(); - $publicUrl = route('qr.public.resolve', ['shortCode' => $qrCode->short_code]); + $publicUrl = \App\Support\LadillLink::url($qrCode->short_code); $typeLabel = \App\Support\Qr\QrTypeCatalog::label($qrCode->type); @endphp diff --git a/resources/views/public/qr/document-viewer.blade.php b/resources/views/public/qr/document-viewer.blade.php index b5f1845..3b66e75 100644 --- a/resources/views/public/qr/document-viewer.blade.php +++ b/resources/views/public/qr/document-viewer.blade.php @@ -111,7 +111,7 @@