I need to overwrite the login,register,logout and 2FA methods to add some logic,
How can i publish it from the vendor?, is there something like php artisan vendor:publish .....
I find that i can overwrite any of fortify pipeline in FortifyServiceProvider by adding the flowing inside boot() function:
# overwrite example
$this->app->singleton(LoginResponseContract::class, LoginResponse::class);
$this->app->singleton(RegisterResponseContract::class, RegisterResponse::class);
.
.
.
It can be a good solution to use a new controller by rewriting the desired route Because then you will have more control power
Route::post('/register', [MyNewController::class, 'store'])
->middleware(['guest:'.config('fortify.guard')]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With