I have 3 tables user can be edited by the user
first table: cars
second table: locations
third table: price,
In addCars.blade.php
, I want to add a price based on location the locations
when I check the checkbox a new price div generate with a new id and inputs id
the car hasMany price based on each location in the database
@foreach ($locations as $locations)
<div class="container-fluid" id="div1">
<div class="fade-in">
<div class="card">
<div class="card-header"> pricing {{ $locations->name }}</div>
<div class="card-body">
<div class="body">
<div class="form-group">
<label for="exampleFormControlInput1">car number</label>
<input type="text" class="form-control" name="carnumber" id="exampleFormControlInput1" placeholder="car number">
</div>
<div class="form-group">
<label for="exampleFormControlInput1">price</label>
<input type="text" class="form-control" name="price" id="exampleFormControlInput1" placeholder="price">
</div>
<div class="form-group">
<label for="exampleFormControlInput1">min day</label>
<input type="text" class="form-control" name="minday" id="exampleFormControlInput1" placeholder="min day">
</div>
<div class="form-group">
<label for="exampleFormControlInput1">sale price</label>
<input type="text" class="form-control" name="saleprice" id="exampleFormControlInput1" placeholder="sale price">
</div>
<div class="form-group">
<label for="exampleFormControlInput1">min day stay</label>
<input type="text" class="form-control" name="mindaystay" id="exampleFormControlInput1" placeholder="min day stay">
</div>
</div>
</div>
</div>
<button type="submit" onclick="location.href='/cars'" class="btn btn-primary">submit</button>
</form>
</div>
</div>
@endforeach