The problem is when the sendResetLink() triggered it shows an error that says: rying to access array offset on value of type null
the component {
public $email;
public function sendResetLink()
{
$this->validate([
'email' => 'required|email',
]);
try {
$status = Password::sendResetLink(['email' => $this->email]);
if ($status === Password::RESET_LINK_SENT) {
session()->flash('success', 'Reset password link sent successfully.');
$this->email = '';
}
} catch (Exception $e) {
session()->flash('error', 'Unable to send reset password link.');
}
}
}
in the laravel documentation the function accepts an array and return string.
the function in the doc:
The problem is when the sendResetLink() triggered it shows an error that says: rying to access array offset on value of type null
the component {
public $email;
public function sendResetLink()
{
$this->validate([
'email' => 'required|email',
]);
try {
$status = Password::sendResetLink(['email' => $this->email]);
if ($status === Password::RESET_LINK_SENT) {
session()->flash('success', 'Reset password link sent successfully.');
$this->email = '';
}
} catch (Exception $e) {
session()->flash('error', 'Unable to send reset password link.');
}
}
}
in the laravel documentation the function accepts an array and return string.
the function in the doc:
$request->validate(['email' => 'required|email']);
$status = Password::sendResetLink(
$request->only('email')
);
Im 100% sure that the array its not null because i tried to add it manully like this:
dd($this->email); // it return the email i entered from the form 🟢
$credentials = ['email' => $this->email];
$status = Password::sendResetLink($credentials); // and still says its null 🔴