F
Filamentβ€’11mo ago
Jamie Cee

Route Middleware resource

Just want to know if theres an easier way to do this before I create a separate page for account information. I have a middleware on my user resource:
protected static string | array $routeMiddleware = [
GlobalTwoFactorAuth::class,
];
protected static string | array $routeMiddleware = [
GlobalTwoFactorAuth::class,
];
However, I want a user to be able to edit their own account regardless of this middleware.
4 Replies
toeknee
toekneeβ€’11mo ago
Can't you add an exception into the middleware class? i.e. if route X and user = user return true
Jamie Cee
Jamie CeeOPβ€’11mo ago
Potentially. Would have to override the middleware, as its coming from a package
toeknee
toekneeβ€’11mo ago
Ahh so just extend it, condition calling the parent?
Jamie Cee
Jamie CeeOPβ€’11mo ago
Yeah, Ill give that a go shortly (got a few other things I need to do first). Cheers πŸ™‚
Want results from more Discord servers?
Add your server