How can I insert the data into the database after hitting submit, I have no idea how to connect the apartment street to the apartment 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>