Support the ongoing development of Laravel.io →
Views Blade

There seems to be many different ways to link across pages. <a href="{{ route('users.index') }}">Users</a> <a href="{{ link_to('/users') }}">Users</a> <a href="{{ URL::route('users.index') }}">Users</a>

Which is the best to use? The same applies for using blade to link to assets. {{ HTML::script('link-area') }}

Which is the best?

Last updated 3 years ago.
0

I always tend to use URL::action('Controller@method') and URL::asset('/path/to/asset')

URL::action() and URL::route() I find are the best to use because they are dynamic, if you change the url of the route, then you don't need to update the url in the view files.

I guess at the end of the day its just personal preference.

Last updated 3 years ago.
0

Whats the difference between URL::route() and just route() though?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.