Answer the question
In order to leave comments, you need to log in
What and when is it preferable to use redirect()->action() and redirect()->route()?
What and when is it preferable to use redirect()->action()
and redirect()->route()
?
Answer the question
In order to leave comments, you need to log in
It is preferable to choose one thing, the same applies to the generation of url addresses. Try not to mix these methods.
When you need to redirect by the name of the route, then you need to use redirect()->route()
.
When you need to redirect by action name, then you need to use redirect()->action()
.
Well, didn't you see the pattern? Are you going to ask about other methods of the redirector too?
There is no preference. Whatever you personally want, then use it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question