From 1aaa24a4d77c43b3931e12aff0affc855abb3f5f Mon Sep 17 00:00:00 2001 From: baghizadizn Date: Mon, 10 Nov 2025 15:16:05 +0700 Subject: [PATCH] penambahan notofikasi --- .../Auth/PasswordResetLinkController.php | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Auth/PasswordResetLinkController.php b/app/Http/Controllers/Auth/PasswordResetLinkController.php index 0177783..7b78639 100644 --- a/app/Http/Controllers/Auth/PasswordResetLinkController.php +++ b/app/Http/Controllers/Auth/PasswordResetLinkController.php @@ -5,9 +5,11 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Password; use Illuminate\View\View; + class PasswordResetLinkController extends Controller { /** @@ -29,16 +31,25 @@ class PasswordResetLinkController extends Controller '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. + // // 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( $status = Password::sendResetLink( $request->only('email') ); - return $status == Password::RESET_LINK_SENT - ? back()->with('status', __($status)) - : back()->withInput($request->only('email')) + // Check if the reset link was successfully sent + if ($status == Password::RESET_LINK_SENT) { + // Flash the success message to the session + Session::flash('success', get_phrase('Check your email to create a new password.')); + + return back(); // Redirect back with the success message + } + + // If the password reset link was not sent, show errors + return back() + ->withInput($request->only('email')) ->withErrors(['email' => __($status)]); } }