{!!Form::open(['route' => 'short','method' => 'GET', 'role' => 'search','class'=>'select-filters'])!!}
<input type="hidden" name=country value="">
<input type="hidden" name=category value="">
<input type="hidden" name=days value="">
<select name="sort_price" id="sort-price" onchange="this.form.submit()">
<option value="" selected="">Sort by price</option>
<option value="lower">Lowest price</option>
<option value="higher">Highest price</option>
</select>
{!! Form::close() !!}
and I've initialized the values in the same page but give the error htmlspecialchars() expects parameter 1 to be string, array given
:@if(Request::only('country') != null)
@else
@endif
@if(Request::only('category') != null)
@else
@endif
@if(Request::only('days') != null)
@else
@endif
The values in Request::only()
is being passed from the search form in index page. When I die and dump:
I throws the incoming value in array formIt dumps individual key value pair if i pass only one argument:
{{dd(Request::only('country'))}}
or{{dd(Request::only('category'))}}
or{{dd(Request::only('days'))}}
via Tanja Forsberg