Boy132 4f1e98c09e change order of operations when registering panel
this makes sure plugins always register after our default configuration
2025-11-05 16:24:12 +01:00

39 lines
1.1 KiB
PHP

<?php
namespace App\Providers\Filament;
use AchyutN\FilamentLogViewer\FilamentLogViewer;
use App\Facades\Plugins;
use Filament\Actions\Action;
use Filament\Facades\Filament;
use Filament\Panel;
class AppPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
$panel = parent::panel($panel)
->id('app')
->default()
->breadcrumbs(false)
->navigation(false)
->topbar(true)
->userMenuItems([
Action::make('to_admin')
->label(trans('profile.admin'))
->url(fn () => Filament::getPanel('admin')->getUrl())
->icon('tabler-arrow-forward')
->visible(fn () => user()?->canAccessPanel(Filament::getPanel('admin'))),
])
->discoverResources(in: app_path('Filament/App/Resources'), for: 'App\\Filament\\App\\Resources')
->plugins([
FilamentLogViewer::make()
->authorize(false),
]);
Plugins::loadPanelPlugins($panel);
return $panel;
}
}