Laravel 5.4 redirection to custom url after login : <p>I am using Laravel Framework 5.4.10, and I am using the regular authentication that </p>

<pre><code>php artisan make:auth
</code></pre>

<p>provides. I want to protect the entire app, and to redirect users to /themes after login.</p>

<p>I have 4 controllers: ForgotPasswordController.php, LoginController.php, RegisterController.php and ResetPasswordController.php. I have edited this line into the last three:</p>

<pre><code>protected $redirectTo = '/themes';
</code></pre>

<p>This is the first line in my routes/web.php:</p>

<pre><code>Auth::routes();
</code></pre>

<p>I have added this function in my Controller.php:</p>

<pre><code>    public function __construct()
    {
        $this-&gt;middleware('auth');

    }
</code></pre>

<p>I have edited app/Http/Middleware/RedirectIfAuthenticated.php, so that the handle function looks like this:</p>

<pre><code>public function handle($request, Closure $next, $guard = null)
{
    if (Auth::guard($guard)-&gt;check()) {
        return redirect('/themes');
    }

    return $next($request);
}
</code></pre>

<p>It's all fine, except when I click the Login button, I get redirected to "/", not "/themes". If I don't require authentication in the controllers (no __contruct function in Controller.php file), I get redirected OK at login. What am I doing wrong? </p>
