Make Ladill Link short URLs fully dynamic at click time.
Deploy Ladill Link / deploy (push) Successful in 1m55s
Deploy Ladill Link / deploy (push) Successful in 1m55s
Forward query strings and path suffixes to the live destination, resolve public hosts from config/custom domains instead of hardcoding ladl.link, and keep proxy Location rewrites on the visitor host.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<x-user-layout>
|
||||
<x-slot name="title">Create Link</x-slot>
|
||||
<div class="mx-auto max-w-xl space-y-6">
|
||||
<div class="mx-auto max-w-xl space-y-6" x-data="{ slug: @js(old('custom_slug', '')) }">
|
||||
<div>
|
||||
<h1 class="text-2xl font-semibold text-slate-900">Create short link</h1>
|
||||
<p class="mt-1 text-sm text-slate-500">
|
||||
Your link will be published on <span class="font-medium text-emerald-700">ladl.link</span>.
|
||||
Your link will be published on <span class="font-medium text-emerald-700">{{ $publicHost }}</span>.
|
||||
GHS {{ number_format($pricePerLink, 2) }} will be debited from your wallet.
|
||||
</p>
|
||||
</div>
|
||||
@@ -35,11 +35,15 @@
|
||||
<div>
|
||||
<label for="custom_slug" class="block text-sm font-medium text-slate-700">Custom slug (optional)</label>
|
||||
<div class="mt-1 flex rounded-lg shadow-sm">
|
||||
<span class="inline-flex items-center rounded-l-lg border border-r-0 border-slate-300 bg-slate-50 px-3 text-sm text-slate-500">ladl.link/</span>
|
||||
<span class="inline-flex items-center rounded-l-lg border border-r-0 border-slate-300 bg-slate-50 px-3 text-sm text-slate-500">{{ $publicHost }}/</span>
|
||||
<input type="text" name="custom_slug" id="custom_slug" value="{{ old('custom_slug') }}"
|
||||
pattern="[a-z0-9][a-z0-9-]{1,18}[a-z0-9]"
|
||||
x-model="slug"
|
||||
class="block w-full rounded-r-lg border-slate-300 focus:border-emerald-500 focus:ring-emerald-500">
|
||||
</div>
|
||||
<p class="mt-1.5 text-xs text-slate-400" x-show="slug" x-cloak>
|
||||
Preview: <span class="font-medium text-emerald-700" x-text="'{{ $publicBaseUrl }}/' + slug"></span>
|
||||
</p>
|
||||
@error('custom_slug')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<div class="min-w-0 flex-1">
|
||||
<h1 class="truncate text-lg font-semibold text-slate-900 lg:text-2xl">Overview</h1>
|
||||
<p class="mt-1 hidden text-sm text-slate-500 sm:block">Short links on <span class="font-medium text-emerald-700">ladl.link</span> — billed from your Ladill wallet</p>
|
||||
<p class="mt-1 hidden text-sm text-slate-500 sm:block">Short links on <span class="font-medium text-emerald-700">{{ $publicHost }}</span> — billed from your Ladill wallet</p>
|
||||
</div>
|
||||
@include('partials.mobile-header-btn', [
|
||||
'href' => route('user.links.create'),
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
<div class="flex flex-col gap-6 lg:flex-row lg:items-center lg:justify-between">
|
||||
<div class="max-w-xl">
|
||||
<div class="inline-flex items-center gap-1.5 rounded-full bg-emerald-100 px-3 py-1 text-xs font-semibold text-emerald-700">
|
||||
Short links · Click analytics · ladl.link
|
||||
Short links · Click analytics · {{ $publicHost }}
|
||||
</div>
|
||||
<h1 class="mt-3 text-2xl font-bold tracking-tight text-slate-900 sm:text-3xl">My Links</h1>
|
||||
<p class="mt-2 text-sm leading-6 text-slate-600">
|
||||
Create branded short URLs on ladl.link, track clicks, and manage destinations from one place.
|
||||
Create branded short URLs on {{ $publicHost }}, track clicks, and manage destinations from one place.
|
||||
</p>
|
||||
<div class="mt-6">
|
||||
<button type="button"
|
||||
@@ -62,7 +62,7 @@
|
||||
</div>
|
||||
@if($links->isEmpty())
|
||||
<div class="px-6 py-12 text-center">
|
||||
<p class="text-sm text-slate-500">No links yet. Create your first short link on ladl.link.</p>
|
||||
<p class="text-sm text-slate-500">No links yet. Create your first short link on {{ $publicHost }}.</p>
|
||||
</div>
|
||||
@else
|
||||
<table class="min-w-full divide-y divide-slate-100">
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
@if (! $link->is_managed_here)
|
||||
<div class="rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900">
|
||||
This ladl.link slug was created in {{ $link->sourceAppLabel() }}. Edit it there — changes sync back here automatically.
|
||||
This {{ \App\Models\ShortLink::publicHost() }} slug was created in {{ $link->sourceAppLabel() }}. Edit it there — changes sync back here automatically.
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user