Wire LadillLink through QrCode model and remaining QR surfaces.
Deploy Ladill Transfer / deploy (push) Successful in 31s
Deploy Ladill Transfer / deploy (push) Successful in 31s
Public URLs, encoded payloads, slug preview, payment callbacks, and asset paths now use ladl.link instead of ladill.com/q/*. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -58,4 +58,6 @@ AFIA_PROVIDER=openai
|
|||||||
AFIA_MODEL=gpt-4o-mini
|
AFIA_MODEL=gpt-4o-mini
|
||||||
AFIA_API_KEY=
|
AFIA_API_KEY=
|
||||||
|
|
||||||
|
LINK_PUBLIC_DOMAIN=ladl.link
|
||||||
|
|
||||||
VITE_APP_NAME="${APP_NAME}"
|
VITE_APP_NAME="${APP_NAME}"
|
||||||
|
|||||||
@@ -313,7 +313,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) {
|
if ($tempLogoPath) {
|
||||||
Storage::disk('qr')->delete($tempLogoPath);
|
Storage::disk('qr')->delete($tempLogoPath);
|
||||||
|
|||||||
+10
-13
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use App\Support\LadillLink;
|
||||||
use App\Support\Qr\QrStyleDefaults;
|
use App\Support\Qr\QrStyleDefaults;
|
||||||
use App\Support\Qr\QrTypeCatalog;
|
use App\Support\Qr\QrTypeCatalog;
|
||||||
use App\Support\Qr\QrWifiPayload;
|
use App\Support\Qr\QrWifiPayload;
|
||||||
@@ -83,23 +84,19 @@ class QrCode extends Model
|
|||||||
|
|
||||||
public function publicUrl(): string
|
public function publicUrl(): string
|
||||||
{
|
{
|
||||||
return self::publicBaseUrl() . '/q/' . $this->short_code;
|
return LadillLink::url($this->short_code);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function publicPath(string $suffix = ''): string
|
||||||
|
{
|
||||||
|
return $suffix === ''
|
||||||
|
? $this->publicUrl()
|
||||||
|
: LadillLink::path($this->short_code, $suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Base URL for public QR links. Always the short platform domain
|
|
||||||
* (ladill.com) — never the signed-in account/product host — so printed
|
|
||||||
* codes and shared links stay short and host-independent of where the QR
|
|
||||||
* was created.
|
|
||||||
*/
|
|
||||||
public static function publicBaseUrl(): string
|
public static function publicBaseUrl(): string
|
||||||
{
|
{
|
||||||
$appUrl = (string) config('app.url');
|
return LadillLink::baseUrl();
|
||||||
$scheme = parse_url($appUrl, PHP_URL_SCHEME) ?: 'https';
|
|
||||||
$host = (string) config('app.platform_domain')
|
|
||||||
?: (parse_url($appUrl, PHP_URL_HOST) ?: 'ladill.com');
|
|
||||||
|
|
||||||
return $scheme . '://' . $host;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Support;
|
namespace App\Support;
|
||||||
|
|
||||||
use App\Models\QrCode;
|
|
||||||
use App\Models\Transfer;
|
use App\Models\Transfer;
|
||||||
use App\Models\TransferFile;
|
use App\Models\TransferFile;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
@@ -16,6 +15,6 @@ class DirectTransferFileUrl
|
|||||||
throw new RuntimeException('Transfer file URL is unavailable.');
|
throw new RuntimeException('Transfer file URL is unavailable.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return QrCode::publicBaseUrl().'/q/'.$shortCode.'/transfer/files/'.$file->id;
|
return LadillLink::path($shortCode, 'transfer/files/'.$file->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Support;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Canonical short-link URLs for the Ladill platform (ladl.link).
|
||||||
|
*/
|
||||||
|
final class LadillLink
|
||||||
|
{
|
||||||
|
public static function baseUrl(): string
|
||||||
|
{
|
||||||
|
$domain = (string) config('link.public_domain', 'ladl.link');
|
||||||
|
|
||||||
|
return 'https://'.$domain;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function url(string $slug): string
|
||||||
|
{
|
||||||
|
return rtrim(self::baseUrl(), '/').'/'.ltrim($slug, '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function path(string $slug, string $suffix): string
|
||||||
|
{
|
||||||
|
return self::url($slug).'/'.ltrim($suffix, '/');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'public_domain' => env('LINK_PUBLIC_DOMAIN', 'ladl.link'),
|
||||||
|
];
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
status: '',
|
status: '',
|
||||||
timer: null,
|
timer: null,
|
||||||
checkUrl: @js(route('events.check-slug')),
|
checkUrl: @js(route('events.check-slug')),
|
||||||
baseUrl: @js(\App\Models\QrCode::publicBaseUrl() . '/q'),
|
baseUrl: @js(\App\Support\LadillLink::baseUrl()),
|
||||||
check() {
|
check() {
|
||||||
clearTimeout(this.timer);
|
clearTimeout(this.timer);
|
||||||
const s = this.slug.trim();
|
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'">
|
:class="status === 'available' ? 'border-green-400' : status === 'taken' || status === 'invalid' ? 'border-red-400' : 'border-slate-200'">
|
||||||
<span class="flex items-center rounded-l-xl border-r border-slate-200 bg-slate-50 px-3 text-xs text-slate-400 whitespace-nowrap select-none"
|
<span class="flex items-center rounded-l-xl border-r border-slate-200 bg-slate-50 px-3 text-xs text-slate-400 whitespace-nowrap select-none"
|
||||||
:class="status === 'available' ? 'border-green-400' : status === 'taken' || status === 'invalid' ? 'border-red-400' : 'border-slate-200'">
|
: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() }}/
|
||||||
</span>
|
</span>
|
||||||
<input type="text" name="custom_short_code"
|
<input type="text" name="custom_short_code"
|
||||||
x-model="slug"
|
x-model="slug"
|
||||||
|
|||||||
Reference in New Issue
Block a user