Answer the question
In order to leave comments, you need to log in
Is there any difference between url()->route("named_route") and route("named_route")?
Hi all.
I have always used url()->route() in links until recently. But they suggested that you can simply route ('route_names')
Tell me, there is no difference how to use it? Or is there still a difference with url()-> or without?
Answer the question
In order to leave comments, you need to log in
We look at the source of the route function:
function route($name, $parameters = [], $absolute = true)
{
return app('url')->route($name, $parameters, $absolute);
}
There is no difference other than the number of characters - both ultimately use \Illuminate\Routing\UrlGenerator
.
PS Set yourself an IDE and you can easily answer such questions yourself - just go to the definition of the functions of interest.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question