Laravel 5 - After login redirect back to previous page

前端 未结 13 2344
广开言路
广开言路 2020-11-30 04:41

I have a page with a some content on it and a comments section. Comments can only be left by users who are signed in so I have added a login form to the page for users to si

13条回答
  •  再見小時候
    2020-11-30 05:10

    in your RedirectIfAuthenticated.php change this code

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

    please notice to :

    return redirect()->intended('/contactus');
    

提交回复
热议问题