Is there any proper way to get back to the previous url url()->previous() works fine but when laravel validation fails it redirect to create or edit (same page) that is causing the issue to stuck into that loop of create or edit.
If you want to return to the route before they went to the create/edit, you need to stash the previous url in session or on the querystring so that after a successful submission you can use it to redirect to the original route.
I was referring to the point that I do not want to change my business logic not even to use the query parameter for the previous url to work with that idea. I just want something which could not be like add the session and then get it (from session it also changes to the previous url ).
I want something to override the url()->previous() the way it works for the validation fails and stuck into the loop to avoid it.