{{-- Reusable phone input with country-code dropdown. Only include this once per page — element ids are fixed, not namespaced per instance. Country list comes from Modules\DigitalMenu\Support\Countries — add a country there and every page that includes this partial picks it up automatically. Usage: @include('digitalmenu::partials.phone_country_selector', [ 'fieldName' => 'phone', // optional, defaults to 'phone'; sets the hidden input's name 'phoneValue' => old('phone'), // optional, defaults to old($fieldName) 'phoneError' => $errors->has('phone'), // optional, defaults to $errors->has($fieldName) ]) --}} @php $phoneCountries = \Modules\DigitalMenu\Support\Countries::all(); $defaultCountry = $phoneCountries[0]; $fieldName = $fieldName ?? 'phone'; $phoneValue = $phoneValue ?? old($fieldName); $phoneError = $phoneError ?? $errors->has($fieldName); @endphp