|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace App\Providers\Filament; |
| 6 | + |
| 7 | +use Filament\Http\Middleware\Authenticate; |
| 8 | +use Filament\Http\Middleware\AuthenticateSession; |
| 9 | +use Filament\Http\Middleware\DisableBladeIconComponents; |
| 10 | +use Filament\Http\Middleware\DispatchServingFilamentEvent; |
| 11 | +use Filament\Panel; |
| 12 | +use Filament\PanelProvider; |
| 13 | +use Filament\Support\Colors\Color; |
| 14 | +use Filament\Support\Enums\Width; |
| 15 | +use Guava\FilamentKnowledgeBase\Plugins\KnowledgeBasePlugin; |
| 16 | +use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; |
| 17 | +use Illuminate\Cookie\Middleware\EncryptCookies; |
| 18 | +use Illuminate\Foundation\Http\Middleware\PreventRequestForgery; |
| 19 | +use Illuminate\Routing\Middleware\SubstituteBindings; |
| 20 | +use Illuminate\Session\Middleware\StartSession; |
| 21 | +use Illuminate\View\Middleware\ShareErrorsFromSession; |
| 22 | + |
| 23 | +class ManualPanelProvider extends PanelProvider |
| 24 | +{ |
| 25 | + public function panel(Panel $panel): Panel |
| 26 | + { |
| 27 | + return $panel |
| 28 | + ->id('manual') |
| 29 | + ->path('manual') |
| 30 | + ->colors([ |
| 31 | + // 'primary' => Color::Amber, |
| 32 | + ]) |
| 33 | + ->maxContentWidth(Width::Full) |
| 34 | + ->viteTheme('resources/css/app.css') |
| 35 | + ->brandLogo(fn () => view('components.brand')) |
| 36 | + ->brandLogoHeight('3rem') |
| 37 | + ->unsavedChangesAlerts() |
| 38 | + ->globalSearch(false) |
| 39 | + ->userMenu(false) |
| 40 | + ->pages([ |
| 41 | + // |
| 42 | + ]) |
| 43 | + ->widgets([ |
| 44 | + // |
| 45 | + ]) |
| 46 | + ->plugins([ |
| 47 | + KnowledgeBasePlugin::make(base_path('docs')), |
| 48 | + ]) |
| 49 | + ->middleware([ |
| 50 | + EncryptCookies::class, |
| 51 | + AddQueuedCookiesToResponse::class, |
| 52 | + StartSession::class, |
| 53 | + AuthenticateSession::class, |
| 54 | + ShareErrorsFromSession::class, |
| 55 | + PreventRequestForgery::class, |
| 56 | + SubstituteBindings::class, |
| 57 | + DisableBladeIconComponents::class, |
| 58 | + DispatchServingFilamentEvent::class, |
| 59 | + ]) |
| 60 | + ->authMiddleware([ |
| 61 | + Authenticate::class, |
| 62 | + ]); |
| 63 | + } |
| 64 | +} |
0 commit comments