Laravel Error: ‘The page has expired due to inactivity. Please refresh and try again.’

If you’re getting( ‘The page has expired due to inactivity. Please refresh and try again.’) error in your laravel project then follow the below steps to remove it.

Step1. Open your terminal/command prompt and run these commands in your project root.

  1. php artisan cache:clear
  2. php artisan config:clear
  3. php artisan route:clear
  4. php artisan view:clear,

Also, try to clear the browser cache along with running these commands.

After that, add the below code in your form method

Total Page Visits: 114 - Today Page Visits: 1