© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•4mo ago•
2 replies
Alan Lima

419 CSRF Error on Livewire after migrating from Laravel 9 + Filament 2 to Laravel 11 + Filament 3

What I am trying to do:

I'm migrating an existing project from Laravel 9 + Filament 2 to Laravel 11 + Filament 3. After the migration, I can see the login page, but when I try to log in, it refreshes and shows a 419 error on the Livewire POST request. PHP 8.2.12.

What I did:

1. Upgraded Laravel from 9 to 11
2. Upgraded Filament from 2 to 3
3. Updated composer.json:
- laravel/framework: ^11.0
- filament/filament: ^3.0
- laraveldaily/laravel-invoices: ^4.0
4. Updated app/Models/User.php:
   public function canAccessPanel(Panel $panel): bool
   {
       return $this->status == 1;
   }
   public function canAccessPanel(Panel $panel): bool
   {
       return $this->status == 1;
   }


5. Fixed AdminPanelProvider.php to use correct resource paths and added ->login()
6. Added livewire/* to CSRF exceptions in app/Http/Middleware/VerifyCsrfToken.php
7. Added 'XSRF-TOKEN' to app/Http/Middleware/EncryptCookies.php exceptions
8. Set SESSION_DOMAIN=127.0.0.1 and SESSION_SECURE_COOKIE=false in .env
9. Removed the old app/Http/Kernel.php
10. Cleared all caches, restarted the server, cleared browser cache/cookies

My issue/the error:

When I click the login button with correct credentials, the page refreshes and I get this error in the browser console:

POST http://127.0.0.1:8000/livewire/update 419 (unknown status)

The browser shows "This page has expired. Would you like to refresh the page?"

Code:
>middleware([
    EncryptCookies::class,
    AddQueuedCookiesToResponse::class,
    StartSession::class,
    AuthenticateSession::class,
    ShareErrorsFromSession::class,
    SubstituteBindings::class,
    DisableBladeIconComponents::class,
    DispatchServingFilamentEvent::class,
], isPersistent: true)
>middleware([
    EncryptCookies::class,
    AddQueuedCookiesToResponse::class,
    StartSession::class,
    AuthenticateSession::class,
    ShareErrorsFromSession::class,
    SubstituteBindings::class,
    DisableBladeIconComponents::class,
    DispatchServingFilamentEvent::class,
], isPersistent: true)


app/Http/Middleware/VerifyCsrfToken.php:
protected $except = [
    'livewire/*',
];

protected $addHttpCookie = true;
protected $except = [
    'livewire/*',
];

protected $addHttpCookie = true;
`
app/Http/Middleware/EncryptCookies.php:

protected $except = [
    'XSRF-TOKEN',
];
protected $except = [
    'XSRF-TOKEN',
];




The CSRF token is present in the session and in the Livewire script tag (data-csrf), but the POST request still fails with 419.
image.png
image.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

419 Error on fresh Laravel + Filament install
FilamentFFilament / ❓┊help
7mo ago
Persistent 419 CSRF Error on Livewire File Uploads behind Cloudflare Tunnel
FilamentFFilament / ❓┊help
11mo ago
Migrating from Laravel Nova to Filament v3
FilamentFFilament / ❓┊help
3y ago
Error installing filament on Laravel version 11
FilamentFFilament / ❓┊help
2y ago