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 @@
{{ $qrCode->label }} @if($allowDownload) - + diff --git a/resources/views/qr-codes/create.blade.php b/resources/views/qr-codes/create.blade.php index 23624d0..cc6e135 100644 --- a/resources/views/qr-codes/create.blade.php +++ b/resources/views/qr-codes/create.blade.php @@ -106,7 +106,7 @@ status: '', timer: null, checkUrl: @js(route('events.check-slug')), - baseUrl: @js(\App\Models\QrCode::publicBaseUrl() . '/q'), + baseUrl: @js(\App\Support\LadillLink::baseUrl()), check() { clearTimeout(this.timer); const s = this.slug.trim(); @@ -126,7 +126,7 @@ :class="status === 'available' ? 'border-green-400' : status === 'taken' || status === 'invalid' ? 'border-red-400' : 'border-slate-200'"> - {{ \App\Models\QrCode::publicBaseUrl() }}/q/ + {{ \App\Support\LadillLink::baseUrl() }}/