Surface destination edits as the core dynamic short-link feature.
Deploy Ladill Link / deploy (push) Successful in 1m40s

Move destination editing to the top of the link page, clarify that the short URL never changes, prevent caches from pinning old redirects, and test that later destination updates take effect immediately.
This commit is contained in:
isaacclad
2026-07-16 20:12:14 +00:00
parent d45f4b5c58
commit 86cac606e0
5 changed files with 105 additions and 42 deletions
+5 -1
View File
@@ -116,7 +116,11 @@ class LinkController extends Controller
return back()->withInput()->withErrors(['destination_url' => $e->getMessage()]);
}
return back()->with('success', 'Link updated.');
$message = isset($validated['destination_url'])
? 'Destination updated. Your short link is unchanged — new clicks go to the new URL.'
: 'Link updated.';
return back()->with('success', $message);
}
public function destroy(ShortLink $link): RedirectResponse
@@ -21,9 +21,16 @@ class LinkRedirectController extends Controller
$link = $this->links->resolve($request, $slug);
if ($link !== null && $link->isDirectRedirect()) {
// Always read the current destination from the DB so edits take effect
// immediately. 302 + no-store so browsers/CDNs do not pin an old Location.
$target = $link->resolveRedirectUrl($request, $path);
return redirect()->away($target, 302);
return redirect()
->away($target, 302)
->withHeaders([
'Cache-Control' => 'no-store, no-cache, must-revalidate, max-age=0',
'Pragma' => 'no-cache',
]);
}
// Catalog / QR ecosystem slugs: proxy so destination stays live in the source app.