Hi I want to append the uri in laravel route function.
e.g we have /search?type=listing
//how do i can achieve this with
route('search',['type'=>'listing'])
Once the we are on the search. I want to have all the variable appended to search like
type=listing&query=blah blah
If I get you right, you want to save all query parameters. Use Request::query()
to get it and then merge with your new parameters.
route('search', array_merge(\Request::query(), ['type' => 'listing'])));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With