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?
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.
Whats the difference between URL::route() and just route() though?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community