feat: inject cookie banner into both Filament panels via renderHook
Adds BODY_END renderHook in TenantPanelProvider and CentralPanelProvider so the cookie consent banner appears on /app/* and /admin/* pages. Alpine.js is already bundled by Livewire/Filament — no CDN needed. Tenant panel uses tenant theme color; central panel uses indigo default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -86,6 +86,16 @@ class CentralPanelProvider extends PanelProvider
|
|||||||
</script>
|
</script>
|
||||||
HTML
|
HTML
|
||||||
)
|
)
|
||||||
|
->renderHook(
|
||||||
|
PanelsRenderHook::BODY_END,
|
||||||
|
fn (): string => Blade::render(<<<'BLADE'
|
||||||
|
@php
|
||||||
|
$tenant = null;
|
||||||
|
$themeColor = '#6366f1';
|
||||||
|
@endphp
|
||||||
|
@include('partials.cookie-banner')
|
||||||
|
BLADE)
|
||||||
|
)
|
||||||
->middleware([
|
->middleware([
|
||||||
EncryptCookies::class,
|
EncryptCookies::class,
|
||||||
AddQueuedCookiesToResponse::class,
|
AddQueuedCookiesToResponse::class,
|
||||||
|
|||||||
@@ -342,6 +342,16 @@ class TenantPanelProvider extends PanelProvider
|
|||||||
</script>
|
</script>
|
||||||
@endif
|
@endif
|
||||||
BLADE)
|
BLADE)
|
||||||
|
)
|
||||||
|
->renderHook(
|
||||||
|
PanelsRenderHook::BODY_END,
|
||||||
|
fn (): string => Blade::render(<<<'BLADE'
|
||||||
|
@php
|
||||||
|
$tenant = app(\App\Tenancy\TenantManager::class)->current();
|
||||||
|
$themeColor = $tenant?->settings['theme_color'] ?? '#3B82F6';
|
||||||
|
@endphp
|
||||||
|
@include('partials.cookie-banner')
|
||||||
|
BLADE)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user