CI Feature / test (push) Successful in 3m50s
Die Datei public/favicon.ico war leer; im head fehlte jeder Icon-Verweis. - Favicon (ICO, SVG, Apple-Touch-Icon) in public/, gemeinsame Komponente x-site.favicon in Website-, Mitglieder- und Vorschau-Layouts - Verwaltung: Icon per Render-Hook zur Anfragezeit statt ->favicon(asset()), weil asset() beim Start den falschen Host liefert - FaviconTest (Dateien, Verweise, Adresse hinter dem Proxy) - Brand-Kit: 15_Lara-Felix-Favicon und 16_Lara-Felix-Kleingrafiken (freigegeben) - KIT_ERGAENZUNG_v2.1_kleingrafiken.md: Prüfung und Umsetzungsvorschlag Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
86 lines
3.3 KiB
PHP
86 lines
3.3 KiB
PHP
<?php
|
|
|
|
namespace App\Providers\Filament;
|
|
|
|
use App\Auth\StaffAuthenticatorName;
|
|
use App\Filament\Auth\StaffLogin;
|
|
use App\Http\Middleware\SanitizeIntendedUrl;
|
|
use Filament\Auth\MultiFactor\App\AppAuthentication;
|
|
use Filament\Http\Middleware\Authenticate;
|
|
use Filament\Http\Middleware\AuthenticateSession;
|
|
use Filament\Http\Middleware\DisableBladeIconComponents;
|
|
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
|
use Filament\Pages\Dashboard;
|
|
use Filament\Panel;
|
|
use Filament\PanelProvider;
|
|
use Filament\Support\Colors\Color;
|
|
use Filament\View\PanelsRenderHook;
|
|
use Filament\Widgets\AccountWidget;
|
|
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
|
use Illuminate\Cookie\Middleware\EncryptCookies;
|
|
use Illuminate\Foundation\Http\Middleware\PreventRequestForgery;
|
|
use Illuminate\Routing\Middleware\SubstituteBindings;
|
|
use Illuminate\Session\Middleware\StartSession;
|
|
use Illuminate\Support\Facades\Blade;
|
|
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
|
|
|
class AdminPanelProvider extends PanelProvider
|
|
{
|
|
public function panel(Panel $panel): Panel
|
|
{
|
|
return $panel
|
|
->default()
|
|
->id('verwaltung')
|
|
->path('verwaltung')
|
|
->login(StaffLogin::class)
|
|
->brandName('Verwaltung')
|
|
->authGuard('staff')
|
|
->colors([
|
|
'primary' => Color::hex('#3b7b09'),
|
|
])
|
|
->multiFactorAuthentication([
|
|
AppAuthentication::make()
|
|
->recoverable()
|
|
->brandName(StaffAuthenticatorName::current()),
|
|
], isRequired: true)
|
|
->discoverResources(in: app_path('Filament/Resources'), for: 'App\Filament\Resources')
|
|
->discoverPages(in: app_path('Filament/Pages'), for: 'App\Filament\Pages')
|
|
->pages([
|
|
Dashboard::class,
|
|
])
|
|
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\Filament\Widgets')
|
|
->widgets([
|
|
AccountWidget::class,
|
|
])
|
|
->middleware([
|
|
EncryptCookies::class,
|
|
AddQueuedCookiesToResponse::class,
|
|
StartSession::class,
|
|
SanitizeIntendedUrl::class,
|
|
AuthenticateSession::class,
|
|
ShareErrorsFromSession::class,
|
|
PreventRequestForgery::class,
|
|
SubstituteBindings::class,
|
|
DisableBladeIconComponents::class,
|
|
DispatchServingFilamentEvent::class,
|
|
])
|
|
->authMiddleware([
|
|
Authenticate::class,
|
|
])
|
|
// Favicon zur Anfragezeit: ->favicon(asset(...)) würde beim Start der Anwendung berechnet, vor der
|
|
// Auswertung von Proxy-Kopfzeilen und geöffneter Adresse, und könnte auf einen falschen Host zeigen.
|
|
->renderHook(
|
|
PanelsRenderHook::HEAD_END,
|
|
fn (): string => view('components.site.favicon')->render(),
|
|
)
|
|
->renderHook(
|
|
PanelsRenderHook::STYLES_AFTER,
|
|
fn (): string => view('filament.cms.styles')->render().view('filament.verwaltung.styles')->render(),
|
|
)
|
|
->renderHook(
|
|
PanelsRenderHook::BODY_END,
|
|
fn (): string => app()->environment('testing') ? '' : Blade::render("@vite('resources/js/app.js')"),
|
|
);
|
|
}
|
|
}
|