JillzTom's avatar

Password Reset Link in Lumen

I'm trying to create a PasswordReset API in Lumen 5.3.

I've the same setup from a default Laravel 5.3 app.

$app->post('/password/email', 'PasswordController@postEmail');
$app->post('/password/reset/{token}', 'PasswordController@postReset');

and in the user Model I've overridden the method as follows:

public function sendPasswordResetNotification($token)
{
        $this->notify(new ResetPasswordNotification($token));
}

I've manually pulled in the Notification package for Lumen 5.3

But, I'm getting the following error:

BindingResolutionException in Container.php line 763:
Target [Illuminate\Contracts\Mail\Mailer] is not instantiable while building [Illuminate\Notifications\Channels\MailChannel].

Anybody knows what am I doing wrong here?

0 likes
3 replies
JillzTom's avatar

Can anybody help me with this? Still struggling with the same problem.

salmon's avatar

Some other issues I ran into before I got it working was:

(1/1) InvalidArgumentException
Route [password.reset] not defined.

FIX: adding 'as' => 'password.reset' to my route.

$app->post('password/reset/{token}', ['as' => 'password.reset', 'uses' => 'Auth\ResetPasswordController@postReset']);

AND

(1/1) FatalThrowableError
Call to undefined function App\Traits\bcrypt()

FIX: Replacing

$user->password = bcrypt($password);

with

$user->password = app('hash')->make($password);

Please or to participate in this conversation.