Any routes you want to have session support, which auth is using in this case, you have to apply the 'web' middleware group.
lagbox said:
Any routes you want to have session support, which auth is using in this case, you have to apply the 'web' middleware group.
can you please explain it with a code snippet ?
You should have something like this in your routes.php file.
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
//
});
In short, move your route for '/' to a route group that has the 'web' middleware or add the 'web' middleware to the '/' route definition.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community