<form action="{{ route('chapter_3.conseil', $url) }}" method="post">
  @csrf
  <div class="modal-body">
    <button type="button" class="btn mb-1 p-0 chapter3_2" data-id="{{ $theme }}" style="width: 25px; float: right; border: 1px solid grey">+</button>
    <table class="table table-bordered mt-" id="{{ $table }}" style="width: 100%">
      <tbody>
        @php $i = 1; @endphp
        @forelse ($input as $item)
        <tr>
          <td class="pb-0">
            <div class="row m-0">
              <div class="col-sm-10 offset-sm-1">
                <label class="col-form-label" for="user{{ $i.'_'.$theme }}">Select user<span class="text-danger">*</span> :</label>
                <select name="tab[]" id="user{{ $i.'_'.$theme }}" class="form-control mb-0">
                  <option value="">Select ...</option>
                  @foreach ($data as $user)
                  <option value="{{ $user->id }}" {{ $user->id == $item->user_id ? 'selected':null}}>{{ ($user->sexe == 'F' ? 'Mme':'Mr').' '.strtoupper($user->first_name).' '.ucwords($user->last_name) }}</option>
                  @endforeach
                </select>
              </div>
            </div>
          </td>
        </tr>
        @php $i++ @endphp
        @empty
        <tr>
          <td class="pb-0">
            <div class="row m-0">
              <div class="col-sm-10 offset-sm-1">
                <label class="col-form-label" for="user1_{{ $theme }}">Select user<span class="text-danger">*</span> :</label>
                <select name="tab[]" id="user1_{{ $theme }}" class="form-control mb-0">
                  <option value="">Select ...</option>
                  @foreach ($data as $user)
                  <option value="{{ $user->id }}">{{ ($user->sexe == 'F' ? 'Mme':'Mr').' '.strtoupper($user->first_name).' '.ucwords($user->last_name) }}</option>
                  @endforeach
                </select>
              </div>
            </div>
          </td>
        </tr>
        @endforelse
      </tbody>
    </table>
  </div>
  <div class="modal-footer">
    <input type="hidden" name="school" value="{{ $school }}">
    <input type="hidden" name="cutting" value="{{ $cutting }}">
    <button class="btn btn-inverse btn-outline-inverse btn-sm py-1 mx-2" data-dismiss="modal">Fermer</button>
    <button class="btn btn-inverse btn-outline-inverse btn-sm py-1 mx-2">Valider</button>
  </div>
</form>