@php $l = $license ?? null; @endphp
<div class="row">
    <div class="col-md-6"><div class="form-group">
        {!! Form::label('user_id', __('medorganization::lang.user') . ':*') !!}
        {!! Form::select('user_id', $users, $l->user_id ?? null, ['class' => 'form-control medorg-select2', 'placeholder' => __('messages.please_select'), 'required']) !!}
    </div></div>
    <div class="col-md-6"><div class="form-group">
        {!! Form::label('license_type', __('medorganization::lang.license_type') . ':*') !!}
        @php
            $typeOptions = array_combine($types, array_map(fn ($t) => __('medorganization::lang.license_type_' . $t), $types));
            if ($l && $l->license_type && ! isset($typeOptions[$l->license_type])) {
                $typeOptions[$l->license_type] = $l->license_type; // keep custom types
            }
        @endphp
        {!! Form::select('license_type', $typeOptions, $l->license_type ?? null, ['class' => 'form-control', 'required']) !!}
    </div></div>
</div>
<div class="row">
    <div class="col-md-6"><div class="form-group">
        {!! Form::label('license_number', __('medorganization::lang.license_number') . ':*') !!}
        {!! Form::text('license_number', $l->license_number ?? null, ['class' => 'form-control', 'required', 'maxlength' => 100]) !!}
    </div></div>
    <div class="col-md-6"><div class="form-group">
        {!! Form::label('issuing_authority', __('medorganization::lang.issuing_authority') . ':') !!}
        {!! Form::text('issuing_authority', $l->issuing_authority ?? null, ['class' => 'form-control', 'maxlength' => 191]) !!}
    </div></div>
</div>
<div class="row">
    <div class="col-md-4"><div class="form-group">
        {!! Form::label('issue_date', __('medorganization::lang.issue_date') . ':') !!}
        {!! Form::date('issue_date', $l && $l->issue_date ? $l->issue_date->toDateString() : null, ['class' => 'form-control']) !!}
    </div></div>
    <div class="col-md-4"><div class="form-group">
        {!! Form::label('expiry_date', __('medorganization::lang.expiry_date') . ':') !!}
        {!! Form::date('expiry_date', $l && $l->expiry_date ? $l->expiry_date->toDateString() : null, ['class' => 'form-control']) !!}
    </div></div>
    <div class="col-md-4"><div class="form-group">
        {!! Form::label('specialization', __('medorganization::lang.specialization') . ':') !!}
        {!! Form::text('specialization', $l->specialization ?? null, ['class' => 'form-control', 'maxlength' => 150]) !!}
    </div></div>
</div>
<div class="form-group">
    {!! Form::label('document_path', __('medorganization::lang.document_path') . ':') !!}
    {!! Form::text('document_path', $l->document_path ?? null, ['class' => 'form-control', 'maxlength' => 191, 'placeholder' => __('medorganization::lang.document_path_help')]) !!}
</div>
<div class="form-group">
    {!! Form::label('notes', __('medorganization::lang.notes') . ':') !!}
    {!! Form::textarea('notes', $l->notes ?? null, ['class' => 'form-control', 'rows' => 2]) !!}
</div>
