I have check box like this:
<input {{isset($shop['private_post'])&&$shop['private_post']=='Yes' ? 'checked' : ''}} id="private_post" value="Yes" type="checkbox" name="private_post">
in controller :
$shop= shop::find($request['id']);
$shop->update($request->all());
In edit mode When I checkbox true work correctly but when I unchecked checkbox dose not work.
I create dynamically checkbox and I can not use this command
If(!isset($request['private_post']))
$request['private_post']=0;
$shop= shop::find($request['id']);
$shop->update($request->all());
I solved it by hidden input
<input type="hidden" value="0" name="private_post">
<input {{isset($shop['private_post'])&&$shop['private_post']=='Yes' ? 'checked' : ''}} id="private_post" value="Yes" type="checkbox" name="private_post">
Try this:
In Blade
{!! Form::checkbox('private_post', '1', Input::old('private_post', 1)) !!}
In Controller
$request['private_post'] = isset($request['private_post']) ? 1 : 0;