Update AdminPanelProvider.php

This commit is contained in:
Bozhidar 2024-09-24 16:33:55 +03:00
parent c71ec174d4
commit 29493603b4

View file

@ -95,14 +95,16 @@ class AdminPanelProvider extends PanelProvider
]); ]);
$defaultColor = Color::Yellow; $defaultColor = Color::Yellow;
$brandLogo = asset('images/phyre-logo.svg'); $brandLogo = null;
$brandName = null;
$isAppInstalled = file_exists(storage_path('installed')); $isAppInstalled = file_exists(storage_path('installed'));
if ($isAppInstalled) { if ($isAppInstalled) {
if (setting('general.brand_logo_url')) { if (setting('general.brand_logo_url')) {
$brandLogo = setting('general.brand_logo_url'); $brandLogo = setting('general.brand_logo_url');
} }
if (setting('general.brand_name')) {
$brandName = setting('general.brand_name');
}
if (setting('general.brand_primary_color')) { if (setting('general.brand_primary_color')) {
$defaultColor = Color::hex(setting('general.brand_primary_color')); $defaultColor = Color::hex(setting('general.brand_primary_color'));
} }
@ -142,8 +144,15 @@ class AdminPanelProvider extends PanelProvider
} }
} }
$panel->brandLogo($brandLogo) if ($brandLogo) {
->brandLogoHeight('2.2rem') $panel->brandLogo($brandLogo);
} else if ($brandName) {
$panel->brandName($brandName);
} else {
$panel->brandLogo(asset('images/phyre-logo.svg'));
}
$panel->brandLogoHeight('2.2rem')
->colors([ ->colors([
'primary'=>$defaultColor, 'primary'=>$defaultColor,
]); ]);