I got the expiration error for Filament Form and could not figure out
my SESSION_DRIVER=database
Could Anyone help me to solve this?
Thanks in advance
p/s: I followed another thread to comment out the middleware: EncryptCookies but it does not work
Solution:Jump to solution
I fixed it.
my route is for 'admin' middleware but Livewire uses Web middleware. So by adding Web middleware to the route. I fixed it.
Route::get('admins/create', [CreateAdmin::class, '__invoke'])->name('filament.admin.resources.admins.create')->middleware(['web', 'admin']);
Those who have a similar issue can refer to it.
livewire update route at Livewire\Mechanisms\HandleRequests;...
5 Replies
Yeah this is not a filament issue, it's laravel
Basically what is happening is your laravel csrf token has expired
At least based off you are telling me
When do you get this?
Without further information it's hard to debug this, but my first question would be, have you created the table and run the migrations to allow the sessions to be stored in the database?
I've never used db sessions personally but I believe this helper command will create the migration for you (then you just need to run the migration of course) - try this:
I can log in normally. Other pages that are not related to filament are fine.
Only pages that link to filament get this.
I doubted the problem relates to livewire/csrf but could not figure it out. Also, no hidden input for form (method) in Filament.
I have all the session, setting tables. Also, my app is not new. It is an existing one; I just discovered Filament and integrated it.
Something is seriously off here. Personally I have never seen a laravel error in a JS alert dialog.
Solution
I fixed it.
my route is for 'admin' middleware but Livewire uses Web middleware. So by adding Web middleware to the route. I fixed it.
Route::get('admins/create', [CreateAdmin::class, '__invoke'])->name('filament.admin.resources.admins.create')->middleware(['web', 'admin']);
Those who have a similar issue can refer to it.
livewire update route at Livewire\Mechanisms\HandleRequests;
function boot()
{
app($this::class)->setUpdateRoute(function ($handle) {
return Route::post('/livewire/update', $handle)->middleware('web');
});
$this->skipRequestPayloadTamperingMiddleware();
}
Thanks all for your help