mercredi 30 octobre 2019

Redirect to previous url except in other urls

I want to redirect a user to the previous url when he login except when a user clicks the reset password . So if a user clicks reset password then tries to login it shouldn't redirect back to reset password page. So far when a user clicks reset password and then tries to login it I get this error The GET method is not supported for this route. Supported methods: POST.. How can I redirect to previous url excepts in other urls like(reset-password)?

I have tried this session(['link' => url()->previous()])->except('password-reset'); and I got an error Call to a member function except() on null

LoginController

 public function showLoginForm()
 {
 session(['link' => url()->previous()]);
 return view('auth.login');
 }

Route

 Route::post('password-reset', 'Auth\ForgotPasswordController@sendPasswordResetToken')->name('password.reset');


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire