I have List of the question and All question is print in a foreach loop. I want to store some question id in the database using checkbox.
@foreach ($allquestion as $indexKey => $all )
<tr>
<th>{{$indexKey+1}}</th>
<th>{{substr($all->question,0,20)}} {{ strlen($all->question)>20
? "..." : ""}}</th>
<td>{{$all->option1}}</td>
<td>{{$all->option2}}</td>
<td>{{$all->option3}}</td>
<td>{{$all->option4}}</td>
<td>{{$all->answer}}</td>
<td>
<div class="form-check">
<input class="form-check-input big-checkbox"
name="present[]" type="checkbox" value="{{$all->id}}"
id="defaultCheck1">
</div>
</td>
</tr> @endforeach
I have no idea where I put submit button and how to get value from a checkbox into Controller to save data.
updated
{!! Form::open(array('route' => 'addq', 'data-parsley-validate' => '',
'files' => true,'method'=>'post')) !!}
@foreach ($allquestion as $indexKey => $all )
<tr>
<th>{{$indexKey+1}}</th>
<th>{{substr($all->question,0,20)}} {{ strlen($all->question)>20 ? "..." : ""}}</th>
<td>{{$all->option1}}</td>
<td>{{$all->option2}}</td>
<td>{{$all->option3}}</td>
<td>{{$all->option4}}</td>
<td>{{$all->answer}}</td>
<td>
<div class="form-check">
<input type="checkbox" class="form-check-input big-checkbox"
name="checked[]" value="{{ $all->id }}">
</div>
</td>
</tr>
@endforeach
{{Form::submit('Create Test',['class'=>'btn btn-primary'])}}
{!! Form::close() !!}
When I Put Button like this no action perform.