Laravel 5 redirect to home page if attempting to go to login screen
You should use middleware for this.
Laravel 5 has already a 'guest' middleware out of the box you can use, so just doing the following should be enough:
Route::get('/', ['middleware' =>'guest', function(){ return view('auth.login');}]);
Then in the middleware file App\Http\Middleware\RedirectIfAuthenticated
you can specify where the user is redirected to.
The default is /home
.
When a user is successfully authenticated, they will be redirected to the /home URI, which you will need to register a route to handle. You can customize the post-authentication redirect location by defining a redirectPath property on the AuthController:
in your AuthController change the redirectPath property
protected $redirectPath = '/dashboard';