点击提交后如何将数据插入数据库,我不知道如何将公寓街道连接到公寓 ID。
<tbody>
@foreach($apartments as $apartment)
<tr>
<input type="hidden" name="id[]" value="{{$apartment->id}}" id="checkApt" />
<td><input type="checkbox" name="apt[]" value="{{$apartment->id}}"id="checkApt"></td>
<td><input type="text" name="street[]" value="{{ $apartment->street }}" id="checkApt"></td>
<td><input type="text" name="aptnumber[]" value="{{ $apartment->apartment_number }}" id="checkApt"> </td>
<td><input type="text" name="price[]" value="{{ number_format($apartment->price, 2) }}"id="checkApt"></td>
<td><input type="text" name="bedrooms[]" value="{{$apartment->bedrooms}}" id="checkApt"></td>
<td><input type="text" name="bathrooms[]" value="{{$apartment->bathrooms}}"id="checkApt"></td>
<td><input type="text" name="date[]" value="{{ date('M d, Y', strtotime($apartment->created_at))}}"id="checkApt"></td>
<td><input type="text" name="area[]" value="{{ $apartment->neighborhood->neighborhood ?? '' }}"id="checkApt"></td>
</tr>
@endforeach
</tbody>
斯蒂芬大帝