Fix boot splash showing merchant icon on Woo Manager.
Deploy Ladill Woo Manager / deploy (push) Successful in 56s
Deploy Ladill Woo Manager / deploy (push) Successful in 56s
Resolve the splash icon from the launcher registry by matching the current host, so woo.ladill.com uses woomanager.svg instead of the subdomain-named woo.svg (which is a copy of the merchant icon). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,7 +1,24 @@
|
||||
@php
|
||||
// Branded boot splash (Ladill Mail style). Self-icon from this app's subdomain.
|
||||
// Branded boot splash (Ladill Mail style). Resolve this app's icon from the
|
||||
// launcher registry by matching the current host's subdomain, so the icon is
|
||||
// correct even when the subdomain slug differs from the icon filename
|
||||
// (e.g. woo.ladill.com -> woomanager.svg).
|
||||
$sub = strtolower((string) ((explode('.', (string) (parse_url((string) config('app.url'), PHP_URL_HOST) ?: '')))[0] ?? ''));
|
||||
$icon = $sub !== '' && is_file(public_path("images/launcher-icons/{$sub}.svg")) ? "images/launcher-icons/{$sub}.svg" : null;
|
||||
$iconFile = null;
|
||||
foreach ((array) config('ladill_launcher.apps', []) as $app) {
|
||||
$host = (string) (parse_url((string) ($app['url'] ?? ''), PHP_URL_HOST) ?: '');
|
||||
$appSub = strtolower((string) ((explode('.', $host))[0] ?? ''));
|
||||
if ($appSub !== '' && $appSub === $sub && !empty($app['icon'])) {
|
||||
$iconFile = (string) $app['icon'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($iconFile === null && $sub !== '') {
|
||||
$iconFile = "{$sub}.svg";
|
||||
}
|
||||
$icon = $iconFile && is_file(public_path("images/launcher-icons/{$iconFile}"))
|
||||
? "images/launcher-icons/{$iconFile}"
|
||||
: null;
|
||||
$label = (string) config('app.name', 'Ladill');
|
||||
@endphp
|
||||
<div id="ladill-boot" role="status" aria-live="polite">
|
||||
|
||||
Reference in New Issue
Block a user