Level 67
Put them in session?
hi,
I was wondering if you could store what checkbox are checked between the page with laravel?
my controller:
public function index()
{
$values = DB::table('mytable')->limit(10)
->paginate(50);
return view('index', compact('values'));
}
my html:
<form action="/test" method="POST">
<button class="btn" name="submit" value="XLSX" type="submit">Exp(XLSX)</button>
<button class="btn" name="submit" value="XLS" type="submit">Exp(XLS)</button>
<input name="value[]" type="hidden" value="0">
<tbody>
@foreach($values as $value)
{!! csrf_field() !!}
<tr>
<td><input name="valeur[]" type="checkbox"
value="{{$value->id}}">{{$value->id}}</td>
</tr>
</tbody>
You can store them in session or create storage keys the other thing you can do is pass them in the url as parameters.
Please or to participate in this conversation.