0

i want my APIs to support routes fallback as the following : if the requested method (for example V4/some-method) does not exist V4 name space then search for it in V3 and if not search for it in V2 ...till found then redirect to it with same request headers and body , and if not found return 404. i have tried to edit the handler.php file the render function in case of 404 but cannot read the request data to get the url called or the headers and body to be able to redirect to the next version. is there anyway to do so?

JokerDev
  • 151
  • 2
  • 15
  • ok now it works but when i redirect using redirect()->to there are no parameters in body. how i can reditect with parameters – JokerDev Aug 29 '21 at 16:41
  • You should "fix" this problem by just creating the routes, if no route matches, then it will be automatically redirected to `404`... I am assuming that `Vx/yyyy-zzzz`, `yyyy-zzzz` is a string that is not defined in a route (you are matching or similar) so it is in a database or anything similar, right ? Can you edit your question explaining this ? – matiaslauriti Aug 31 '21 at 08:45
  • i have already edited handler.php render fucntion case of 404 if reqeust not found redirect to the next Version route , but request gone there without parameters,i have used redirect->route but request redirected with out the parameters, redirect-> to also , thanks for your reply sir. – JokerDev Aug 31 '21 at 14:52

0 Answers0