'target [Laravel\Fortify\Contracts\RegisterViewResponse] is not instantiable
i'm have a router register but i found error
Target [Laravel\Fortify\Contracts\RegisterViewResponse] is not instantiable.
Solution 1:[1]
You need to register fortify service provider inside the config/app.php
files
Add this
App\Providers\FortifyServiceProvider::class,
to config/app.php
under the Application's Service Providers.
Update : It is also important you point the location of your authentication views to Fortify.
An example for the Register view would be:
// auth.register => means your register.blade is located in `view/auth/`
// folder. (All things being equal)
Fortify::registerView(function () {
return view('auth.register');
});
Read More: https://laravel.com/docs/9.x/fortify#registration
Solution 2:[2]
you have to add all these in FortifyServiceProvider.php at the boot method. then import all classes needed
Fortify::loginView(function(){
return view('auth.login');
});
Fortify::authenticateUsing(function(Request $request){
$user = User::where('email',$request->email)->first();
if($user && Hash::check($request->password,$user->password)){
return $user;
}
});
Fortify::registerView(function(){
return view('auth.register');
});
after that you need to create the register and login view
Solution 3:[3]
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);
Solution 4:[4]
Make registerView function on app/providers/FortifyServiceProvider.php
Fortify::registerView(function () {
return view('auth.register');
});
Solution 5:[5]
In addition to Joseph Ajibodu's answer, within the boot method of FortifyServiceProvider
add the following:
Fortify::loginView(function () {
return view('auth.login');
});
Fortify::registerView(function () {
return view('auth.register');
});
Fortify::requestPasswordResetLinkView(function () {
return view('auth.forgot-password');
});
Fortify::resetPasswordView(function () {
return view('auth.reset-password');
});
Solution 6:[6]
Fortify::registerView(function () { return view('auth.register');
put this code in your fortyfive service provider folder under the book method
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | MHAMMED TALHAOUY |
Solution 3 | Sergio Gualberto Cruz Epinoza |
Solution 4 | Riki krismawan |
Solution 5 | liamvictor |
Solution 6 |