default() ->darkMode(true) ->id('admin') ->path('admin') ->login() ->renderHook( name: PanelsRenderHook::TOPBAR_START, hook: fn (): string => Blade::render('@livewire(\'quick-service-restart-menu\')') ) // ->topNavigation() ->unsavedChangesAlerts() ->globalSearch(true) ->databaseNotifications() ->font('Albert Sans') ->sidebarWidth('15rem') // ->brandLogo(fn () => view('filament.admin.logo')) ->navigationGroups([ 'Hosting Services' => NavigationGroup::make()->label('Hosting Services'), 'Docker' => NavigationGroup::make()->label('Docker'), 'Server Management' => NavigationGroup::make()->label('Server Management'), ]) ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources') ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages') ->pages([ Pages\Dashboard::class, ]) ->plugins([ // FilamentAuthenticationLogPlugin::make(), FilamentApexChartsPlugin::make(), FilamentSettingsPlugin::make()->pages([ GeneralSettings::class, ]), ]) // ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets') ->widgets([ ServerDiskUsageStatistic::class, ServerMemoryStatistic::class, // ServerMemoryStatisticCount::class, CustomersCount::class, Websites::class, // Widgets\AccountWidget::class, // Widgets\FilamentInfoWidget::class, ]) ->middleware([ EncryptCookies::class, AddQueuedCookiesToResponse::class, StartSession::class, AuthenticateSession::class, ShareErrorsFromSession::class, VerifyCsrfToken::class, SubstituteBindings::class, DisableBladeIconComponents::class, DispatchServingFilamentEvent::class, ]) ->authMiddleware([ Authenticate::class, ]); $defaultColor = Color::Yellow; $brandLogo = null; $brandName = null; $isAppInstalled = file_exists(storage_path('installed')); if ($isAppInstalled) { if (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')) { $defaultColor = Color::hex(setting('general.brand_primary_color')); } $findModules = Module::where('installed', 1)->get(); if ($findModules->count() > 0) { foreach ($findModules as $module) { // Search in main path $modulePathClusters = module_path($module->name, 'Filament/Clusters'); if (is_dir($modulePathClusters)) { $panel->discoverClusters(in: $modulePathClusters, for: 'Modules\\' . $module->name . '\\Filament\\Clusters'); } $modulePathPages = module_path($module->name, 'Filament/Pages'); if (is_dir($modulePathPages)) { $panel->discoverPages(in: $modulePathPages, for: 'Modules\\' . $module->name . '\\Filament\\Pages'); } $modulePathResources = module_path($module->name, 'Filament/Resources'); if (is_dir($modulePathResources)) { $panel->discoverResources(in: $modulePathResources, for: 'Modules\\' . $module->name . '\\Filament\\Resources'); } // Search in app path $modulePathClusters = module_path($module->name, 'App/Filament/Clusters'); if (is_dir($modulePathClusters)) { $panel->discoverClusters(in: $modulePathClusters, for: 'Modules\\' . $module->name . '\\App\\Filament\\Clusters'); } $modulePathPages = module_path($module->name, 'App/Filament/Pages'); if (is_dir($modulePathPages)) { $panel->discoverPages(in: $modulePathPages, for: 'Modules\\' . $module->name . '\\App\\Filament\\Pages'); } $modulePathResources = module_path($module->name, 'App/Filament/Resources'); if (is_dir($modulePathResources)) { $panel->discoverResources(in: $modulePathResources, for: 'Modules\\' . $module->name . '\\App\\Filament\\Resources'); } } } } if ($brandLogo) { $panel->brandLogo($brandLogo); } else if ($brandName) { $panel->brandName($brandName); } else { $panel->brandLogo(asset('images/phyre-logo.svg')); } $panel->brandLogoHeight('2.2rem') ->colors([ 'primary'=>$defaultColor, ]); $panel->renderHook( name: PanelsRenderHook::BODY_START, hook: fn (): string => Blade::render('@livewire(\'jobs-queue-notifications\')') ); return $panel; } }