O
O
ortsuev332019-11-30 16:50:00
Laravel
ortsuev33, 2019-11-30 16:50:00

How can I change the redirect from the home page to the main page when the user visits the login or register page?

How can I change the redirect from the home page to the main page when the user visits the login or register page?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
ortsuev33, 2019-11-30
@ortsuev33

Found at random, /app/Http/Middleware RedirectIfAuthenticated.php

public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->check()) {
            return redirect('/');//тута)
        }

        return $next($request);
    }

G
godyesnow, 2019-11-30
@godyesnow

Isn't it? - \app\Http\Controllers\Auth\LoginController.php

/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/home';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question