Target [Laravel\Fortify\Contracts\ResetsUserPasswords] is not instantiable

Viewed 1460

I am implementing the forgot password / password reset logic with Laravel 8 and Fortify for an SPA application.

When the /reset-password is called and if the data are all correct (email, password, password_confirmation, token), I get a server side error:

Target [Laravel\Fortify\Contracts\ResetsUserPasswords] is not instantiable.

The route is defined as follows in api.php:

Route::post('/reset-password', [NewPasswordController::class, 'store']);

Thanks for your help

2 Answers

I had the same issue in my API and I was able to resolve it.

Target [Laravel\Fortify\Contracts\ResetsUserPasswords] is not instantiable.

Laravel\Fortify\Contracts\ResetsUserPasswords is an interface, and Fortify (by default) has implemented the ResetsUserPassword Action which implements the interface.

All you need to get it working is to ensure this class App\Providers\FortifyServiceProvider::class is registered within the providers array of your application's config/app.php configuration file.

// ...
App\Providers\FortifyServiceProvider::class,
Related