mardi 17 mai 2016

Update checkbox in laravel controller

I have check box like this:

<input  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());



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1qsPvWS
via IFTTT

Aucun commentaire:

Enregistrer un commentaire