F
Filament4mo ago
Arre

Error with updating a post request -(CSRF-token) - Livewire/update

What I'm Trying to Do: I'm creating a settings page using the Spatie Laravel Settings plugin. What I Did: I recently resumed coding after a 5-6 month break. The last time I coded was with Laravel 10.10, right before Laravel 11 was released. Transitioning to Laravel 11 has been very challenging, especially with the structural changes in the framework. Previously, I had everything working just fine in v.10.10. However, since the update to Laravel 11 and the changes to the app folder, I'm encountering issues. Specifically, I'm receiving a CSRF error, and the POST request isn't updating as expected. The Issue/Error: I'm getting a 419 Page Expired error, which indicates a CSRF token issue. I do have a _token in the payload. If I disable CSRF protection in boostrap/app.php, everything works fine, but I know disabling CSRF is not a good practice and should only be a temporary solution. The request is being sent to /livewire/update, and I'm unsure how to resolve this issue with Laravel 11's new structure, especially since the middleware folder has been removed. I'm also not sure if it's interfering with Spatie's MediaLibrary since I do also have that installed. Where the icon/favicon could be causing the issue here.
1 Reply
toeknee
toeknee4mo ago
1. you never needed to change the structure as the old structure is still supported. CSRF-Token should just be refreshed when needed.
Want results from more Discord servers?
Add your server