Filament Shield: 403 Forbidden on Production but Works Fine Locally
Hi everyone, I need some help regarding an issue I’ve been facing with Filament Shield in a Laravel project.
We’re using Filament Shield to handle permissions for our admin panel. On local development, everything works perfectly. After migrating the database, I run:
It prompts me to input name, email, and password for a super admin user. Once that's done, I can log in and access all admin resources via /admin as expected.
However, in production, I followed the exact same steps:
Login using the generated user
But when I try to access /admin, I get a 403 Forbidden error.
I'm guessing it has something to do with the role/permission assignment or caching, but I’m not sure.
8 Replies
Hi
Things changed with the new version of filament shield (^v3.3)
Which version are you on?
Did you setup the
canAccessPanel
method on the user Model?Solution
Yeah, I had this issue. Filament auth isn't checked whilst APP_ENV is set to local IIRC
In the new version of shield, you need to run shield:setup
i am using
thanks guys, solved using canAccessPanel, thanks
Yeah---! Really, really need to change that feature