-
Add a hidden field ?
-
It is search urls, you dont care if it is pretty or not.
Link to append parameter to current query in URL
I once watched a video on the site about the following but can't seem to find it anywhere.
I have a form which is used to search by subject and postcode. The form makes a get request and the url then looks like:
http://example.com/search?subjects%5B%5D=Piano&postcode=SE10+5BE
Now I want to add a link to append another query, say within=10 to look like this:
http://example.com/search?subjects%5B%5D=Piano&postcode=SE10+5BE&within=10
I have two questions:
-
How do I use a link to reload the page but add a parameter while not loosing the old ones.
-
How do I use str_slug to make the url prettier (currently subjects[] is encoded as subjects%5B%5D
Thank you for your time! I'm happy to be pointed to a discussion or video!
Thank you! That worked :)
{!! link_to_route('search', 'Within 10 miles', ['subject' =>Input::get('subjects'), 'postcode' => Input::get('postcode'), 'within' => '10'] ) !!}
Is it ok to use Input::get() in a view?
Please or to participate in this conversation.