I have a checkbox array that has its values stored as JSON in a database, I want to get the old value or the stored value in the database. here is the code I wrote.
It did not work as I expected, is there a best practice to deal with this issue?
<?php $savedDevices = json_decode(Auth::user()->devices, true);?>
<input type="checkbox" name="devices[Android Phone]" value="1" > Android Phone </label>
<input type="checkbox" name="devices[Android Tablet]" value="1" > Android Tablet </label>
<input type="checkbox" name="devices[iPhone]" value="1" > iPhone </label>
<input type="checkbox" name="devices[iPad]" value="1" > iPad </label>
via Chebli Mohamed
1 commentaire:
How To Retrieve Check Box Value In Laravel
We can retrieve check box value in table using controller. Here you can see, we use the variable like product which passed from the controller and used it in table for getting database records..
For More Info:- How To Retrieve Check Box Value In Laravel
Enregistrer un commentaire