DHL Modul v0.5 Shipping Label ok
This commit is contained in:
parent
480fdc65ed
commit
8fdaa0ba1d
122 changed files with 17938 additions and 2239 deletions
|
|
@ -129,62 +129,4 @@ if (! function_exists('legal_url')) {
|
|||
return url($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('main_asset')) {
|
||||
/**
|
||||
* Generate an asset URL using the main domain to avoid CORS issues.
|
||||
* This ensures all assets are loaded from the main domain regardless of subdomain.
|
||||
*/
|
||||
function main_asset($path)
|
||||
{
|
||||
// Entferne führende Slashes
|
||||
$path = ltrim($path, '/');
|
||||
|
||||
// Baue die Hauptdomain-URL
|
||||
$protocol = config('app.protocol', 'https://');
|
||||
$domain = config('app.domain', 'mivita');
|
||||
$tld = config('app.tld_care', '.care');
|
||||
|
||||
return $protocol . $domain . $tld . '/' . $path;
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('cors_asset')) {
|
||||
/**
|
||||
* Alias for main_asset for backward compatibility and clarity.
|
||||
*/
|
||||
function cors_asset($path)
|
||||
{
|
||||
return main_asset($path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('route')) {
|
||||
/**
|
||||
* Route auf Hauptdomain generieren
|
||||
*/
|
||||
function route($name, $parameters = [], $absolute = true)
|
||||
{
|
||||
$url = route($name, $parameters, $absolute);
|
||||
|
||||
// Ersetze Subdomain mit Hauptdomain
|
||||
if (request()->hasHeader('X-Subdomain')) {
|
||||
$currentHost = request()->getHost();
|
||||
$url = str_replace($currentHost, config('app.domain').config('app.tld_care'), $url);
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('asset_route')) {
|
||||
/**
|
||||
* Asset/Storage Route immer auf Hauptdomain
|
||||
*/
|
||||
function asset_route($name, $parameters = [])
|
||||
{
|
||||
return 'https://' . config('app.domain') . config('app.tld_care') . route($name, $parameters, false);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue