EncryptCookies middleware 419 page expired error

I have a custom SimplePage with a form that is throwing a 419 error every time I try to submit it. I have tried also to create a filament-form component with the exact same result. After some digging I've noticed the issue is related with the \Illuminate\Cookie\Middleware\EncryptCookies middleware and the problem goes away as soon as I remove the middleware from the panel or my custom route. Any ideas why?
Solution:
Ok so looks like I've found the solution. I had to modify the AdminPanelProvider and change: use Illuminate\Cookie\Middleware\EncryptCookies; to:...
Jump to solution
4 Replies
Solution
Abel Cobreros
Abel Cobreros16mo ago
Ok so looks like I've found the solution. I had to modify the AdminPanelProvider and change: use Illuminate\Cookie\Middleware\EncryptCookies; to: use App\Http\Middleware\EncryptCookies; Not sure why as the App one extends from the Illuminate class. Will leave it here in case it helps anyone.
saineshmamgain
saineshmamgain11mo ago
You saved the day. Thanks
limewater23
limewater239mo ago
it doesn't work for me, still have 419 | PAGE EXPIRED
indra
indra9mo ago
Your custom form may need the csrf directive to inject hidden csrf token add
@csrf
@csrf
within your form tag See reference from this docs: https://laravel.com/docs/10.x/csrf
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Want results from more Discord servers?
Add your server