'Email tidak boleh kosong', 'email.email' => 'Email tidak valid', 'email.exists' => 'Email tidak terdaftar', ]; $validator = Validator::make($request->all(), [ 'email' => ['required', 'email', 'exists:users,email'], ], $customMessages); if ($validator->fails()) { toast($validator->messages()->all()[0], 'error')->position('top')->autoclose(3000); return redirect()->back()->withInput(); } DB::table('password_reset_tokens')->updateOrInsert(['email' => $request->email], [ 'token' => Hash::make($request->_token), 'created_at' => now(), ]); alert()->success('Berhasil', 'Silahkan cek email anda untuk mereset password'); return redirect()->back(); } // public function store(Request $request): RedirectResponse // { // $request->validate([ // 'email' => ['required', 'email'], // ]); // // We will send the password reset link to this user. Once we have attempted // // to send the link, we will examine the response then see the message we // // need to show to the user. Finally, we'll send out a proper response. // $status = Password::sendResetLink( // $request->only('email') // ); // return $status == Password::RESET_LINK_SENT // ? back()->with('status', __($status)) // : back()->withInput($request->only('email')) // ->withErrors(['email' => __($status)]); // } }