How to generate route with query string parameter in Laravel 5?

By Hardik Savani | April 7, 2016 | | 62114 Viewer | Category : Laravel


Whenever you require to add query string parameter in link url, i mean in route then you generate link with query string parameter using Laravel 5 URL facade. most of new developer doing this way:

<a href="{{ URL::route('home') }}.'?id=1&test_id=2'">Test</a>

But you should do it that this way, bellow example you can see how it done.

<a href="{{ URL::route('home',['id'=>'2','test_id'=>'3']) }}">Test</a>




Hardik Savani
My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
Follow Me: Github Twitter
***Do you want me hire for your Project Work? Then Contact US.