Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rahulsphd's avatar

What is the different between URL::route() and route()

What is the difference between URL::route() and route() because both return URLs so which one should use?

0 likes
2 replies
SilenceBringer's avatar
Level 55

@rahulsphd they are equal. You can use whetever you want

sometimes you can just check the source code and have answer. Check route() helper

    function route($name, $parameters = [], $absolute = true)
    {
        return app('url')->route($name, $parameters, $absolute);
    }

so, really route calls Url::route

Please or to participate in this conversation.