Q:

Change default login URL

I am trying to change default login URL redirection when unauthenticated use tries to access a page. Basically it redirects to /login but I want it to '/' 
I am using the default laravel Auth which is created by php artisan make:auth. I just want to redirect to other URL when it's unauthenticated user.
Note: I'm at Laravel 5.6

A:

With default auth scaffolding Laravel will redirect to a route named login.
Option 1
Put this in your app/Exceptions/Handler.php:
use Illuminate\Auth\AuthenticationException;

// ... Other stuff

protected function unauthenticated($request, AuthenticationException $exception)
{
    return $request->expectsJson()
                ? response()->json(['message' => $exception->getMessage()], 401)
                : redirect()->guest('/');
}

Put your desired url in redirect()->guest('/');
Option 2
Rename the route you want to redirect to to login:
Auth::routes();
Route::get('/', function () {
    return 'login';
})->name('login');

And change the form action from route('login') to /login in resources/views/auth/login.blade.php:
<form method="POST" action="/login">

