How to get all the Checked Checkboxes values From View to Controller???
My view page code is,
{!! Form::checkbox('control_type[]', 001, '', array('id'=>'control_type', 'name'=>'control_type[]')) !!} {!! trans('noorsi.control_type_001') !!}</br>
{!! Form::checkbox('control_type[]', 002, '', array('id'=>'control_type', 'name'=>'control_type[]')) !!} {!! trans('noorsi.control_type_002') !!}</br>
{!! Form::checkbox('control_type[]', 003, '', array('id'=>'control_type', 'name'=>'control_type[]')) !!} {!! trans('noorsi.control_type_003') !!}
and my controller page code is,
$control_type = $request->get('control_type');
I just want to get the values(001,002...) of checked checkboxes... Can anyone help me...?
In your controller you can get the values like $request->input('control_type')
. This will be an array. Now you can loop through the array to get the individual values.
like:
foreach($request->input('control_type') as $value){
// $value
}