I have a field price like:
<div>
<label for="price">Price</label>
<input type="hidden" name="price" id="price"/>
<input type="number"
onkeydown="javascript: return event.keyCode == 69 ? false : true"
min="0" step="any"
class="form-control"
value="{{ old('price') }}"
name="price" id="price" placeholder="Price (Ex: 10,00)"/>
</div>
If the user introduce for exampel "10.15" the $request->all() shows this field like:
"price" => "10.15"
But in the database the price is stored as 10. I have the column price as intenger.Then I also have a page where the price can be edited and the price in the form field appear as "10", but it should be "10.15".
Do you know how to store the value "10.15" in DB and show the proper value "10.15" in the edit page?
In the controller the price is stored in DB like:
'price' => $request->price,