From c173256deded4268d82668276368b8f0e94698a6 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Mon, 8 Jun 2026 16:08:22 +0000 Subject: [PATCH] Use short ladill.com/q links for transfer shares and emails. Share URLs and API public_url values again use the platform domain so ladill.com/q/* forwards to transfer.ladill.com like other Ladill apps. Co-authored-by: Cursor --- app/Http/Controllers/Api/ChunkedUploadController.php | 2 +- app/Http/Controllers/Api/TransferController.php | 2 +- app/Models/QrCode.php | 8 -------- app/Notifications/TransferRecipientNotification.php | 2 +- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/Api/ChunkedUploadController.php b/app/Http/Controllers/Api/ChunkedUploadController.php index 68b47db..edc90c9 100644 --- a/app/Http/Controllers/Api/ChunkedUploadController.php +++ b/app/Http/Controllers/Api/ChunkedUploadController.php @@ -139,7 +139,7 @@ class ChunkedUploadController extends Controller 'data' => [ 'id' => $transfer->id, 'title' => $transfer->title, - 'public_url' => $transfer->qrCode?->shareUrl(), + 'public_url' => $transfer->qrCode?->publicUrl(), 'paid_until' => $transfer->paid_until?->toIso8601String(), 'expires_at' => $transfer->paid_until?->toIso8601String(), 'files' => $transfer->files->map(fn ($file) => [ diff --git a/app/Http/Controllers/Api/TransferController.php b/app/Http/Controllers/Api/TransferController.php index 952ed93..31d782e 100644 --- a/app/Http/Controllers/Api/TransferController.php +++ b/app/Http/Controllers/Api/TransferController.php @@ -68,7 +68,7 @@ class TransferController extends Controller 'data' => [ 'id' => $transfer->id, 'title' => $transfer->title, - 'public_url' => $transfer->qrCode?->shareUrl(), + 'public_url' => $transfer->qrCode?->publicUrl(), 'paid_until' => $transfer->paid_until?->toIso8601String(), 'expires_at' => $transfer->paid_until?->toIso8601String(), 'files' => $transfer->files->map(fn ($file) => [ diff --git a/app/Models/QrCode.php b/app/Models/QrCode.php index a4a8676..14e628f 100644 --- a/app/Models/QrCode.php +++ b/app/Models/QrCode.php @@ -86,14 +86,6 @@ class QrCode extends Model return self::publicBaseUrl() . '/q/' . $this->short_code; } - /** Direct link for emails and share UI — always on the Transfer app host. */ - public function shareUrl(): string - { - $base = rtrim((string) config('app.url'), '/'); - - return $base . '/q/' . $this->short_code; - } - /** * Base URL for public QR links. Always the short platform domain * (ladill.com) — never the signed-in account/product host — so printed diff --git a/app/Notifications/TransferRecipientNotification.php b/app/Notifications/TransferRecipientNotification.php index 720ab68..9450a19 100644 --- a/app/Notifications/TransferRecipientNotification.php +++ b/app/Notifications/TransferRecipientNotification.php @@ -24,7 +24,7 @@ class TransferRecipientNotification extends Notification public function toMail(mixed $notifiable): MailMessage { $transfer = $this->transfer->loadMissing(['files', 'qrCode', 'user']); - $publicUrl = $transfer->qrCode?->shareUrl() ?? ''; + $publicUrl = $transfer->qrCode?->publicUrl() ?? ''; return (new MailMessage()) ->subject($this->subjectLine())