diff --git a/resources/views/partials/boot-splash.blade.php b/resources/views/partials/boot-splash.blade.php index 5d86769..175ee9a 100644 --- a/resources/views/partials/boot-splash.blade.php +++ b/resources/views/partials/boot-splash.blade.php @@ -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