2
My question is this:: I have a search form (GET), and would like to know how when running Submit send these parameters to the URL in a friendly way.
Obs.: parameters are not mandatory.
Form:
{{ Form::open(array('route' => 'neighborhoods.city', 'class' => 'form-inline', 'method' => 'get')) }}
<div class="form-group col-xs-2 col-lg-2 col-md-2">
{{ Form::select('state_id', $states, 0, array('class' => 'form-control input-lg', 'id' => 'states')) }}
</div>
<div class="form-group col-xs-8 col-lg-8 col-md-8" id="cidades">
{{ Form::select('city_id', $cities, 0, array('class' => 'form-control input-lg', 'disabled' => true)) }}
</div>
<div class="form-group col-xs-2 col-lg-2 col-md-2">
{{ Form::submit('Buscar', array('class' => 'btn btn-default btn-lg btn-block btn-submit')) }}
</div>
{{-- Form::text('search', Input::old('search'), array('class' => 'form-control', 'placeholder' => 'Digite aqui o que você está procurando. Ex.: Encanador'))--}}
{{ Form::close() }}
That’s what I thought too, I don’t really like depending on js, but apparently it’s the best solution.
– Patrick Maciel
If I didn’t get it wrong, when you’re talking Session is literally putting the data into the session?
– Patrick Maciel
Exactly, then you update the data in the session only when you receive a request via POST. But if you need the data to be in a url, so it can be shared already filtered, there is no way, or you do it the way I talked to JS, or leave it in the default format generated by the form
– Brayan