penambahan notofikasi

This commit is contained in:
baghizadizn 2025-11-10 15:16:05 +07:00
parent 5c37c28cad
commit 1aaa24a4d7

View File

@ -5,9 +5,11 @@ namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Password; use Illuminate\Support\Facades\Password;
use Illuminate\View\View; use Illuminate\View\View;
class PasswordResetLinkController extends Controller class PasswordResetLinkController extends Controller
{ {
/** /**
@ -29,16 +31,25 @@ class PasswordResetLinkController extends Controller
'email' => ['required', 'email'], 'email' => ['required', 'email'],
]); ]);
// We will send the password reset link to this user. Once we have attempted // // 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 // // 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. // // need to show to the user. Finally, we'll send out a proper response.
// $status = Password::sendResetLink(
$status = Password::sendResetLink( $status = Password::sendResetLink(
$request->only('email') $request->only('email')
); );
return $status == Password::RESET_LINK_SENT // Check if the reset link was successfully sent
? back()->with('status', __($status)) if ($status == Password::RESET_LINK_SENT) {
: back()->withInput($request->only('email')) // 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)]); ->withErrors(['email' => __($status)]);
} }
} }