Laravel 5.2: How do I read a checkbox saved in a column?
For example, there is a set of check boxes below:
{!! Form::open(array('url' => 'foo/bar')) !!} 1 2 3 Submit {!! Form::close() !!}
In the controller, receive the selected item:
$checkboxes = $request->input('checkbox');
Once received, the Json_encode () is converted to a JSON format and stored in a column of the data table.
The problem is:
In the "edit page", you need to read these items, displayed in the "edit Page", the previously selected items to be selected, not selected items are not selected, what should be done?
Reply content:
Laravel 5.2: How do I read a checkbox saved in a column?
For example, there is a set of check boxes below:
{!! Form::open(array('url' => 'foo/bar')) !!} 1 2 3 Submit {!! Form::close() !!}
In the controller, receive the selected item:
$checkboxes = $request->input('checkbox');
Once received, the Json_encode () is converted to a JSON format and stored in a column of the data table.
The problem is:
In the "edit page", you need to read these items, displayed in the "edit Page", the previously selected items to be selected, not selected items are not selected, what should be done?
read out the data Json_decode () to the array, in the page loop to determine the value of the values equal to a checked property