Fresh Laravel Nova returns 419 expired after form submit

Viewed 1260

I've added Laravel Nova to my Laravel app (v7.x). There is nothing special configured within my middlewares/service providers/etc.

Whenever I submit a form from Nova, it results in a 419 Page expired error.

The VerifyCsrfTokenMiddleware throws an error, saying there is a "CSRF token missmatch".

All views and assets are default as they came by the Laravel Nova installation script.

Any idea, what causes this problem?

1 Answers

I recently faced the same problem. I resolved it by adding the following line to my .env file:

SESSION_DOMAIN=.domain.tld

Where domain.tld is your domain obviously. Don't forget the initial dot.

Also, if you're using Laravel passport and your site is fresh, don't forget to execute php artisan passport:install

Related