Laravel 5.3 set homepage as login screen

in laravel in general you can change the url view path to what you want as example

Route::get('/', function () {
    return view('auth.login');
});

I just needed to specify the middleware('auth') for my route:

 Route::get('/', function () {
        return view('home');
    })->middleware('auth');

    Route::get('/home', 'HomeController@index');

This way if you're not logged in it will redirect to login automatically.


You can do it like this:

Route::group(['middleware' => 'auth'], function () {
    Route::get('/', function () {
        return view('welcome');
   });
});

Just put all the routes that needed authentication inside that middleware group.