Can anyone help me with laravel broker function. I have users and sellers page and each has forgot password. It works with users but not in sellers. I tried using ChatGPT to fix my code and it suggests to add sellers in return Password::broker('sellers');
.
class ForgotSellerController extends Controller
{
use SendsPasswordResetEmails;
public function sendResetLinkEmail(Request $request)
{
$request->validate([
'email' => 'required|email' // Validates the email input
]);
$response = $this->broker()->sendResetLink(
$request->only('email')
);
if ($response) {
Log::info('Password reset response for sellers: ' . $response);
return redirect()->back()->with('status', 'An email has been sent!');
}
return $response == Password::RESET_LINK_SENT
? back()->with('status', trans($response))
: back()->withErrors(['email' => trans($response)]);
}
public function broker()
{
return Password::broker('sellers');
}
How can I separate the 2 tables to have their own forgot passwords?