3 namespace App\Http\Controllers\Auth;
5 use App\Http\Controllers\Controller;
6 use Illuminate\Http\Request;
7 use Illuminate\Support\Facades\Password;
9 class PasswordResetLinkController extends Controller
12 * Display the password reset link request view.
14 * @return \Illuminate\View\View
16 public function create()
18 return view('auth.forgot-password');
22 * Handle an incoming password reset link request.
24 * @param \Illuminate\Http\Request $request
25 * @return \Illuminate\Http\RedirectResponse
27 * @throws \Illuminate\Validation\ValidationException
29 public function store(Request $request)
32 'email' => ['required', 'email'],
35 // We will send the password reset link to this user. Once we have attempted
36 // to send the link, we will examine the response then see the message we
37 // need to show to the user. Finally, we'll send out a proper response.
38 $status = Password::sendResetLink(
39 $request->only('email')
42 return $status == Password::RESET_LINK_SENT
43 ? back()->with('status', __($status))
44 : back()->withInput($request->only('email'))
45 ->withErrors(['email' => __($status)]);