I want to add or minus the number of medicine stock that is being stored. Are there better ways to do better than mine.
@if(count($medicines) > 0)
@foreach($medicines as $medicine)
@if($medicine->medicine_details==="Non-Prescribed")
<tr>
<th scope="row">{{$medicine->medicine_name}}</th>
<th scope="row">{{$medicine->medicine_details}}</th>
<td>{{$medicine->medicine_qty}}
@include('forms.incrementMed')
</td>
</tbody>
@endif
@endforeach
@endif
This is the Form that I included
@if( $medicine->medicine_qty < 100)
<input style="width: 50px;" class="box" type="number" id="qty" value="qty">
<button type="submit" class="btn btn-secondary" data-dismiss="modal" name="addMed" id="addMed" >Add</button>
@elseif( $medicine->medicine_qty >= 100)
<input style="width: 50px;" class="box" type="number" id="qty" value="qty">
<button type="submit" class="btn btn-secondary" data-dismiss="modal" name="minusMed" id="minusMed" >Minus</button>
@endif
And how do I change the value of the stored medicine_qty to the new one that is being added or minus