@if ($showLabel && $options['label'] !== false && $options['label_show']) {!! Form::customLabel($name, $options['label'], $options['label_attr']) !!} @endif @php $countryCodeEnabled = setting('phone_number_enable_country_code', true); $withCountryCodeSelection = $countryCodeEnabled && isset($options['with_country_code_selection']) && $options['with_country_code_selection']; $inputName = $withCountryCodeSelection ? $name . '_display' : $name; $fieldId = $options['attr']['id'] ?? 'phone-field-' . Str::random(8); $inputAttributes = $options['attr']; $inputAttributes['class'] = trim(($options['attr']['class'] ?? '') . ' js-phone-number-mask form-control'); $inputAttributes['id'] = $fieldId; if ($withCountryCodeSelection) { $inputAttributes['data-country-code-selection'] = 'true'; } @endphp {!! Form::text($inputName, $options['value'], $inputAttributes) !!} @if ($withCountryCodeSelection) {!! Form::hidden($name, $options['value'], [ 'class' => 'js-phone-number-full', 'data-phone-field' => $inputName, 'id' => $fieldId . '-full', ]) !!} @endif @if ($withCountryCodeSelection) @once @include('core/base::forms.fields.phone-number-script') @endonce @endif