Within my project, I have given the administrator role the privilege to add users to the site. For security reasons, I hash a random string, to store as the temporary password, I then want to send the user an email with the standard Laravel reset password template.
I have the following:
$user = new User();
$user->name = Input::get('name');
$user->email = Input::get('email');
$user->password = Hash::make(str_random(8));
$user->save();
$response = Password::sendResetLink(Input::get('email'), function (Message $message) {
$message->subject('Password Reset');
});
The error I'm getting is
Argument 1 passed to Illuminate\Auth\Passwords\PasswordBroker::sendResetLink() must be of the type array, string given
How can I trigger this function within Laravel, so the user is sent a password reset email? Thank you.
sendResetLinkexpects an array and you're providing a string.