компонент {
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.');
}
}
в документации laravel функция принимает массив и возвращает строку.
функция в документе:
$request->validate(['email' => 'required|email']);
$status = Password::sendResetLink(
$request->only('email')
);
Я на 100 % уверен, что массив не равен нулю, поскольку пытался добавить его вручную следующим образом:
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
Подробнее здесь: https://stackoverflow.com/questions/788 ... l-livewire
Мобильная версия