erlenwald/filament-phone-input
Filament v5 phone input field with searchable country picker, favorites, per-country masks, and auto country detection. Configurable output format/state paths, optional country state field, default/IP lookup, and optional SVG flags. No intl-tel-input.
Pros:
required(), label()). Aligns with Filament’s declarative, component-based architecture.Cons:
intl-tel-input: Relies on custom logic for phone validation/masking, which may require additional testing for edge cases (e.g., invalid numbers).intl)./ip-country), adding minimal infrastructure requirements.countries() method mitigates this.Validate or a custom library like libphonenumber?['US', 'CA']).filament/filament is installed (core dependency).composer require erlenwald/filament-phone-input
php artisan vendor:publish --tag=filament-phone-input-assets
php artisan vendor:publish --tag=filament-phone-input-translations
php artisan vendor:publish --tag=filament-phone-input-styles
php artisan optimize:clear
php artisan filament:assets
PhoneInput::make('phone')->....PhoneInput::make('contact_number')
->label('Phone Number')
->required()
->defaultCountry('US')
->countries(['US', 'GB', 'DE'])
->phoneNumberFormat(PhoneNumberFormat::E164);
phone as E164 or national format).composer update and republish assets if changes affect flags/translations.lang/vendor/...) for localization.resources/css/vendor/.../phone-input.css for styling.filament:assets execution.phoneNumberFormat.countries() to restrict to well-supported regions.countries() to avoid rendering 249 options.->defaultCountry(fn () => auth()->user()->preferredCountry)
| Failure Point | Impact | Mitigation |
|---|---|---|
| Missing flag assets | Flags show as text codes | Automate asset publishing in CI/CD. |
| IP lookup endpoint down | No auto-country detection | Disable IP lookup or use fallback. |
| Invalid phone format | Server-side validation fails | Implement robust Laravel validation. |
| CSS/JS conflicts | Field renders incorrectly | Test in isolation; inspect browser console. |
| Database schema mismatch | Form submission errors | Align state paths with existing DB. |
How can I help you explore Laravel packages today?