laravel-backpack

Liste pages throws error 419, page expired


I have just updated to v6.0 and I got an issue with all pages showing a 419 error. List pages don't work at all anymore and create pages work fine event with the error displayed first.

Laravel debugbar says it's a CSRF mismatch and I get errors in the console saying some assets are not found.

Screenshot of listed errors

PHP VERSION:

PHP 8.2.0 (cli) (built: Dec 6 2022 15:31:23) (ZTS Visual C++ 2019 x64) Copyright (c) The PHP Group Zend Engine v4.2.0, Copyright (c) Zend Technologies with Zend OPcache v8.2.0, Copyright (c), by Zend Technologies with Xdebug v3.2.0RC1, Copyright (c) 2002-2022, by Derick Rethans

LARAVEL VERSION:

10.15.0.0

BACKPACK PACKAGE VERSIONS:

backpack/basset: 1.0.0 backpack/crud: 6.0.5 backpack/generators: v4.0.0 backpack/permissionmanager: 7.0.0 backpack/theme-coreuiv2: 1.1.3

I tried following the upgrade guide several times while making sure I'm not skipping any steps but cannot get to get it to work.

I get there's an issue with storage link as the links in the console are showing double / on the url. But this was working fine before the update and I've never got this thing.


Solution

  • I had the same problem and it blocked me for days. All you have to do is change the "APP_URL" variable in the .env file of the Laravel project.

    Mine used to be "APP_URL=localhost", but that didn't work. Then I changed it to "APP_URL=http:// movie.test" and it worked. knowing that "http:// movie.test" is the local domain name I created for my project.

    So all you have to do is change the "APP_URL" variable to the correct address. :-)