laravel / fortify

Backend controllers and scaffolding for Laravel authentication.
https://laravel.com/docs/fortify
MIT License
1.61k stars 294 forks source link

Target [Laravel\Fortify\Contracts\CreatesNewUsers] is not instantiable. #7

Closed jozeflambrecht closed 4 years ago

jozeflambrecht commented 4 years ago

Illuminate\Contracts\Container\BindingResolutionException Target [Laravel\Fortify\Contracts\CreatesNewUsers] is not instantiable.

Steps To Reproduce:

Windows environment

laravel new jetstream --jet --dev select livewire and teams php artisan migrate php artisan serve

Register a new user and click "Register"

zaknesler commented 4 years ago

Make sure that you are registering the service providers in config/app.php:

App\Providers\FortifyServiceProvider::class,
App\Providers\JetstreamServiceProvider::class, // If using Jetstream
jozeflambrecht commented 4 years ago

Thanks @zaknesler

pwnedDesal commented 3 years ago

Make sure that you are registering the service providers in config/app.php:

App\Providers\FortifyServiceProvider::class,
App\Providers\JetstreamServiceProvider::class, // If using Jetstream

does not work on me image

NoOorZ24 commented 3 years ago

Make sure that you are registering the service providers in config/app.php:

App\Providers\FortifyServiceProvider::class,
App\Providers\JetstreamServiceProvider::class, // If using Jetstream

does not work on me

https://github.com/laravel/fortify#authentication

kystudio-jerry commented 3 years ago

Make sure that you are registering the service providers in config/app.php:

App\Providers\FortifyServiceProvider::class,
App\Providers\JetstreamServiceProvider::class, // If using Jetstream

does not work on me image

you just need use one of list in your config/app.php depend on your solution by fortify or jetstream.

semul commented 3 years ago

php artisan config:clear can solve this issue.

shortdark commented 3 years ago

The Fortify docs give you this for /login...

Fortify::loginView(fn () => view('auth.login'));

But, for /register you would also need this...

Fortify::registerView(fn () => view('auth.register'));

Not having this will cause the error...

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

seguce92 commented 3 years ago

Make sure that you are registering the service providers in config/app.php:

App\Providers\FortifyServiceProvider::class,
App\Providers\JetstreamServiceProvider::class, // If using Jetstream

does not work on me image

Verify that the following providers are registered in the config.app file in the providers section

App\Providers\FortifyServiceProvider::class,
App\Providers\JetstreamServiceProvider::class, // If using Jetstream

Uncomment the following line in the App\Providers\FortifyServiceProvider.php file

Fortify::createUsersUsing(CreateNewUser::class);
wandumi commented 3 years ago

@seguce92 did you manage to solve the problem?

seguce92 commented 3 years ago

@seguce92 did you manage to solve the problem?

Yes, do the above steps and everything worked correctly.

wandumi commented 3 years ago

@seguce92 I think lots of peoples solution it halfway, I am seeing it will require me to create the views to finalize the whole process right? I just installed and because I saw the login URL I thought it will work as laravel/UI was doing.

kishanterry commented 6 months ago

Landed here after installing Jetstream, if none of the above solution works, check the ./bootstrap/providers.php. It should look like:

<?php

return [
    App\Providers\AppServiceProvider::class,
    App\Providers\FortifyServiceProvider::class,
    App\Providers\JetstreamServiceProvider::class,
];

The return array was missing App\Providers\FortifyServiceProvider::class, for me ... somehow the automagic missed it.

Cheers!

hasminC commented 2 months ago

Landed here after installing Jetstream, if none of the above solution works, check the ./bootstrap/providers.php. It should look like:

<?php

return [
    App\Providers\AppServiceProvider::class,
    App\Providers\FortifyServiceProvider::class,
    App\Providers\JetstreamServiceProvider::class,
];

The return array was missing App\Providers\FortifyServiceProvider::class, for me ... somehow the automagic missed it.

Cheers!

This solved the problem for me. Thanks!