<div class="row mb-3">
    <label for="company_id" class="col-md-4 col-form-label text-md-end">Compañia</label>

    <div class="col-md-6">
        @php
        $selected = old('company_id') ?? $company_id ?? null;
        @endphp
        <select name="company_id" id="company_id" class="form-control  @error('company_id') is-invalid @enderror">
            <option value="">-- Seleccionar Compañia --</option>
            @foreach($companies as $company)
            <option value="{{ $profile->company_id }}" {{ $selected == $profile->company_id ? 'selected' : '' }}>{{ $company->name }}</option>
            @endforeach
        </select>

        @error('company_id')
        <span class="invalid-feedback" role="alert">
            <strong>{{ $message }}</strong>
        </span>
        @enderror
    </div>


</div>

<div class="row mb-3">
    <label for="office_id" class="col-md-4 col-form-label text-md-end">Oficina</label>

    <div class="col-md-6">
        @php
        $selected = old('office_id') ?? $office_id ?? null;
        @endphp
        <select name="office_id" id="office_id" class="form-control  @error('office_id') is-invalid @enderror">
            <option value="">-- Seleccionar Oficina --</option>
            @foreach($offices as $office)
            <option value="{{ $office->office_id }}" {{ $selected == $office->office_id ? 'selected' : '' }}>{{ $office->name }}</option>
            @endforeach
        </select>

        @error('office_id')
        <span class="invalid-feedback" role="alert">
            <strong>{{ $message }}</strong>
        </span>
        @enderror
    </div>


</div>