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.
28 lines
635 B
PHP
28 lines
635 B
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
/**
|
|
* Canonical short-link URLs for the Ladill platform.
|
|
* Domain is always read from config (LINK_PUBLIC_DOMAIN) — never hard-coded.
|
|
*/
|
|
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, '/');
|
|
}
|
|
}
|