I am using the following styled radio button:
The issue is that the value is 0 by default instead of 1, And when i "OFF" the radio button returns NULL
.
$categoryItem->status = Input::get('status');
<input type="checkbox" name="status" data-render="switchery" data-theme="default" checked="1" data-switchery="true" style="display: none;">
edit input code :
<input type="checkbox" name="status" data-render="switchery" data-theme="default" checked="checked" value="1" data-switchery="true" style="display: none;">
if checked check box , get value to server side code 1. if uncheck check box , not sent value for server side.so get response server side POST or GET input=>status undefined or NULL
The issue has been resolved by simple if-else condition.
if(Input::get('status') == null){
$status = 0;
}else{
$status=1;
}