1

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].

What am I missing here?

user1012181
  • 8,648
  • 10
  • 64
  • 106

1 Answers1

0

Add the following line in your bootstrap/app.php

$app->alias('mailer', \Illuminate\Contracts\Mail\Mailer::class);
Jithin
  • 2,594
  • 1
  • 22
  • 42