© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
7 replies
DysonSphere

Custom Middleware in Filament

I have a custom login in my Filament app but the problem is I'm having trouble in preventing users from going back to my custom login. I implemented a prevent-back-history middleware in my custom login but it's not working.

I also added my custom middleware in

->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
PreventBackHistory::class,
])
->authMiddleware([
Authenticate::class,
]);

but whenever I pressed the back button, I always go back to my custom login.

How to add a custom middleware in Filament to prevent users from going back to my custom login page?
Solution
if you did it laravel way then your route is in
web.php
web.php
rigth? add guest middleware so only guest users would be able to access it than maybe
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Middleware auth + custom in Filament Blade
FilamentFFilament / ❓┊help
11mo ago
Middleware and Filament
FilamentFFilament / ❓┊help
3y ago
filament panel authentication middleware
FilamentFFilament / ❓┊help
2y ago
Custom grid structure in filament
FilamentFFilament / ❓┊help
2y ago