redirect()
Providing a Examples of intended
the method that can be redirected to a page request attempts to access a page, and receives a jump address default parameters, when the last request record is empty, a default jump to the address.
public function store(Request $request) { $credentials = $this->validate($request, [ 'email' => 'required|email|max:255', 'password' => 'required' ]); if (Auth::attempt($credentials, $request->has('remember'))) { session()->flash('success', '欢迎回来!'); $fallback = route('users.show', Auth::user()); return redirect()->intended($fallback); } the else { the session () -> Flash ( 'Danger', 'We're sorry, your mailbox and password do not match' ); return the redirect () -> Back () -> withInput (); } }