1

I'm using eClass - Learning Management System by media-city, which built in Laravel 8 (PHP 7.4). Bought it from themeforest. It's currently works fine run on server. But recent time I bought a new domain. So that, I want to switch old domain to new one. I tried to run my system on localhost & new domain; it's frontend works fine. But when I tried to login or signup; it shows "419 PAGE EXPIRED."

I tried ->

php artisan key:generate php artisan route:clear php artisan view:clear php artisan cache:clear php artisan config:clear

There is @csrf in login/signup page. Nothing is working; so, need a solution.

imonDev
  • 13
  • 1
  • 5
  • Please review this question [Here](https://stackoverflow.com/questions/52583886/post-request-in-laravel-error-419-sorry-your-session-419-your-page-has-exp) – Yousef Altaf Dec 18 '21 at 19:50
  • None of these above worked for me. In https://; it works fine but in http://; It's not working. – imonDev Dec 21 '21 at 08:19

1 Answers1

0

I have a Jetstream application that was displaying the same error in production environment.

I solved it by adding the following code to the boot() function of AppServiceProvider:

use Illuminate\Support\Facades\URL;

...

if($this->app->environment('production') || $this->app->environment('staging')) {
    URL::forceScheme('https');
}

Please let us know if this solution fits your problem or if you have found another one.

Source: https://laracasts.com/discuss/channels/nova/frustrating-419-page-expired-on-login-using-jetstream

Ayrton
  • 1
  • 1