I have got a serious problem about fetching data into the view after getting all the values from multiple checkboxes. I can fetch the last value checked, but no more.
Here's my controller:
public function getFilterPaytv(){
$valore = Input::get('opt');
if(!empty($valore))
foreach ($valore as $val) {
$results = Tpaytv::where('Desc', 'LIKE', '%' . $val . '%')->get();
echo $val . ""; //
// echo $results
}
return View::make('result')->with('results', $results);
}
and here's my view
@if($results->count())
@foreach($results as $pa)
<div class="col-lg-12 ">
<div class="box">
<div class="row">
<div class="col-lg-2"><img src="img/T.png" class="timC"></div>
<div class="col-lg-4">
<ul class="boxCar">
<li>Pro: {{$pa->Type}}</li>
<li>Sca: {{ date("d/m/Y",strtotime($pa -> S))}}</li>
<li
data-toggle="modal"
data-target="#{{ $pa->id }}">
<a>Magg</a></li>
</ul>
</div>
<!--inizio modal -->
<!-- fine modal -->
<div class="col-lg-3"><h1 class="ads">{{$pa->T}}€</h1></div>
<div class="col-lg-3">
{{
link_to_route('confr.show',
'request ',
array($paytv->id),
array('class' => 'btn btn-green btn-md offButton'))
}}
</div>
</div>
</div>
</div>
@endforeach
@else
no
@endif
See Question&Answers more detail:os