I'm using laravel 5.4
, my question is how can I pass a second parameter from a different form.
I know when I have multiple inputs in the same form I can pass multiple parameters
<form action="" method="get">
<input type="text" name="country" placeholder="country">
<input type="text" name="town" placeholder="town">
</form>
If I search here I would get something like website.com/?country=croatia&town=zagreb
but how can I get the same result but from two forms
<form action="" method="get">
<input type="text" name="country" placeholder="country">
</form>
<form action="" method="get">
<input type="text" name="town" placeholder="town">
</form>
I need to be able to search one form, and then the second if I want lets say I search for a country first and I get
website.com/?country=croatia
and now I want to search also for a town and I get
website.com/?country=croatia&town=zagreb
It should work the other way around!(If I search for a town first and the a country second. I know that this is a bad example)
A bit complicated what you are trying to do. But there are some workarounds.
Your first form
<form action="" method="get">
<input type="text" name="country" placeholder="country">
</form>
Your second form
<form action="" method="get">
<input type="hidden" name="country" value="{{ request('country') }}">
<input type="text" name="town" placeholder="town">
</form>
When you submit the second form, it will actually recreate the URL by taking the values from the URL. At the end of the day, you have your second form "adding" parameters to the URL.