How can I get the current panel with a custom route?

I have two panels, portal on /portal and admin on /admin. The portal panel is the "default" panel.

If I have a route like the following, how can I have Filament register the panel based on the path?

Route::get('/admin/test', function () {
    dd(Filament::getCurrentPanel()); // wrong panel (gets default panel which is portal)
});
Was this page helpful?