barryw33
3 years ago
103
2
Laravel

firing a redirect from an event

Posted 3 years ago by barryw33

I have a reset_password field within my users table that is set to '1' when a user account is created . When a user logs in I check this field and if set to '1' within an event. I want to redirect from the event if the field is set to '1'.

I have tried:

return redirect()->route('user/change_password');

and in my routes file I have set Route::get('user/change_password', 'UserController@resetpasswordform');

but this returns an error of: InvalidArgumentException in UrlGenerator.php line 306: Route [user/change_password] not defined.

I have also tried this return redirect()->action('UserController@resetpasswordform');

but this is just ignores the redirect and logs the user in. I have set a dd('hello'); within the method but this does nothing.

I have tried changing the redirect for an authenticated user and if the field is not set to 1 then follows this redirect, but if the field is set to 1 it ignores this.

I am at a loss as to the route that this redirect is taking

any help greatly appreciated

Please sign in or create an account to participate in this conversation.