This is because, you are not using the auth middleware on you / route. In your routes.php file the default for this is:
Route::get('/', function () {
return view('welcome');
});
Try moving this closure into the web middleware that was added in when you generated the scaffolding. Your routes.php file should look something like this when complete:
<?php
/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
// Route::get('/', function () {
// return view('welcome');
// });
/*
|--------------------------------------------------------------------------
| 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 () {
//
});
Route::group(['middleware' => 'web'], function () {
Route::auth();
// Add this!
Route::get('/', function () {
return view('welcome');
});
Route::get('/home', 'HomeController@index');
});