SimplePage not using a Panel for Render Hooks/Colors

Hello, I'm trying to create a simple page that mimics the Login page but for the 2FA code. Is it possible to have it use my panel? I tried using
Filament::setCurrentPanel
Filament::setCurrentPanel
but it still doesn't use my render hooks OR colors. I'd use a regular page but I need this page to be for unauthenticated users because they aren't logged in until the 2FA is confirmed.
4 Replies
Dennis Koch
Dennis Koch3mo ago
What render hooks and colors did you define?
Zombiezach8
Zombiezach83mo ago
The color is just a blue that matches my website, I've already tried doing the trick for putting something in AppServiceProvider which works but doesn't fix the render hook. The render hook just adds my website global theme/footer which works great. Is it possible to have my hooks run on a specific route? I noticed if I forced the hooks to run on every route instead of my filament panel it worked
Dennis Koch
Dennis Koch3mo ago
I noticed if I forced the hooks to run on every route instead of my filament panel it worked
How did you "force" that? Please share some code. Otherwise this is just guessing
Zombiezach8
Zombiezach83mo ago
I'm doing
FilamentView::registerRenderHook(
PanelsRenderHook::BODY_START,
fn (): View => view('layouts.header'),
);
FilamentView::registerRenderHook(
PanelsRenderHook::BODY_START,
fn (): View => view('layouts.header'),
);
inside my RenderHooks.php middleware. I only load this from my
$panel->middleware([])
$panel->middleware([])
. If I load this middleware for all routes instead of only for my PanelProvider it decides to load the hooks correctly for the SimplePage. Ahh I got it to work mostly by forcing the middleware in the route
web.php
web.php
file for this specific route. Though is it possible to force a PanelProvider somehow? It won't load the logo and such but I still don't with it to try force auth the user
Want results from more Discord servers?
Add your server