F
Filament3mo ago
mks

Hello,

I have a fresh Install of Laravel/filament/shield and it works perfectly on local machine. When I uploaded to production via Envoyer/Forge, I had to run php artisan shield:install to create the superadmin. I successfully created user. This user logs in and a 403 error appears. Here is snippet of composer.json... "name": "laravel/laravel", "type": "project", "description": "The skeleton application for the Laravel framework.", "keywords": ["laravel", "framework"], "license": "MIT", "require": { "php": "^8.2", "bezhansalleh/filament-shield": "^3.2", "filament/filament": "^3.2", "filament/forms": "^3.2", "filament/tables": "^3.2", "laravel/framework": "^11.9", "laravel/tinker": "^2.9", "livewire/livewire": "^3.5" Regards, Khalid
Solution:
Thats the point, on local envs you can access all panels, but if your app is in prod you need to have that function on the model, otherwise you'll get 403, if you want the user to have access 100% just make it return true
Jump to solution
6 Replies
Bruno Pereira
Bruno Pereira3mo ago
Check if you have the canAccessPanel on your User model on production
mks
mksOP3mo ago
Thank for your reply, I have commented canAccessPanel out at the moment. But on the local machine it works, just fine.
Solution
Bruno Pereira
Bruno Pereira3mo ago
Thats the point, on local envs you can access all panels, but if your app is in prod you need to have that function on the model, otherwise you'll get 403, if you want the user to have access 100% just make it return true
Bruno Pereira
Bruno Pereira3mo ago
It's the first thing that the link I put says
mks
mksOP3mo ago
Thanks... I have set the return to true for now. I will come back to this later.
Want results from more Discord servers?
Add your server