<form class="row g-3 auto-width relatives" action="{{ route('accounts.relative.update', $data->id)}}" method="post" enctype='multipart/form-data'>
    <!-- For validation comment on -->
    <!-- <form class="row g-3 was-validated"> -->
    @csrf
    @method('PUT')
    <div class="col-md-12">
        <label class="form-label">Relation Type <span class="text-danger"><b>*</b></span></label>
        <select class="single-select form-control" id="relation_type" name="relation_type" required>
            @foreach($types as $type)
            <option value="{!! $type->relation_name !!}" {!! ($type->relation_name == $data->relation_name) ? 'selected':'' !!}>{!! $type->relation_name !!}</option>
            @endforeach
        </select>
        <span class="text-danger error_address_type_id" style="display: none;">This field is required.</span>
    </div>
    <div class="col-md-6">
        <label for="relation_name" class="form-label">Name <span class="text-danger"><b>*</b></span></label>
        <input type="text" name="relation_name" value="{!! $data->relation_name !!}" class="form-control">
    </div>
    {{-- <div class="col-md-6">
        <label for="relation_phone" class="form-label">Phone <span class="text-danger"><b>*</b></span></label>
        <input type="tel" name="relation_phone" value="{!! $data->relation_phone !!}" id="relation_phone" class="form-control">
    </div> --}}
    <div class="col-md-6 phone_no_col">
        <label class="form-label">Phone no</label>
        <input type="tel" class="form-control" placeholder="" id="relation_phone" value="{!! $data->relation_phone !!}" />
        <input type="hidden" name="relation_phone">

        @if ($errors->has('relation_phone'))
        <span class="text-danger">{{ $errors->first('relation_phone') }}</span>
        @endif
        <span class="text-danger error_phone" style="display:none;">This field is required.</span>
    </div>
    <div class="col-md-6">
        <label for="relation_occupation" class="form-label">Occupation <span class="text-danger"><b>*</b></span></label>
        <input type="text" name="relation_occupation" value="{!! $data->relation_occupation !!}" class="form-control">
    </div>
    <div class="col-md-6">
        <label for="priority" class="form-label">Priority <span class="text-danger"><b>*</b></span></label>
        <input type="number" name="priority" class="form-control" value="{!! $data->priority !!}">
        <span class="text-danger error_priority" style="display: none;">This field is required.</span>
    </div>
</form>
