tanthammar/filament-country-select
Filament Country Select provides a searchable country picker field for Filament forms, showing country names and flags while storing standard ISO codes. Easy to drop into forms for consistent country selection.
composer require tanthammar/filament-country-select, then confirm the service provider is auto-discovered (no manual registration needed on Laravel 10/11+ with package discovery enabled).php artisan vendor:publish --tag="filament-country-select-config") and at the field class itself — the field extends Filament's Select, so anything you know about Select (searchability, ->native(), ->preload(), validation) applies here too.string(2) column. This is the least surprising choice and keeps you compatible with laravel/framework's country validation rule, Stripe, and most address APIs.use Tanthammar\CountrySelect\...\CountrySelect; // check the namespace in the package README
CountrySelect::make('country')
->searchable()
->required()
->default('NL');
Then render it back in a table column with the flag + translated name rather than the raw code.
$user->country_name) or a helper keeps the rest of the app free of package imports, which makes swapping the package later trivial.->options()/allowed-countries method or a ->in() validation rule backed by the same config array). Define that list once in config/ and reuse it in the validation rule so the UI and the rule can't drift.['required', 'string', 'size:2', Rule::in(array_keys($allowed))]. Don't rely on the field's ->required() alone — Livewire payloads are user-controlled.->live() + ->afterStateUpdated() if you want to auto-set the dial code, but keep the phone number stored in E.164. Recomputing the dial code on every hydration is a common source of flicker in Filament forms.__('...') in your own lang files, not from the package.assertFormSet(['country' => 'TR']). Label-based assertions break the moment translations change (as 1.1.2 demonstrates).İ problem (fixed in 1.1.2). PHP's mb_strtolower('İ') returns "i̇" (an i plus a combining dot above), not a plain i. Any search/normalisation that lowercases country names will fail to match Türkiye, İran, İrlanda, İzlanda, etc. 1.1.2 ships Turkish aliases so those names still resolve. If you maintain your own country list or your own search normaliser, mirror this: strip combining marks after lowercasing, or use a transliteration table — never assume strtolower/mb_strtolower round-trips.strtolower() anywhere in the address stack. On a Turkish-locale server, strtolower('I') yields ı. If you validate or key options by lowercased codes, you will get intermittent, locale-dependent failures that never reproduce on your dev machine. Always uppercase ISO codes explicitly.composer update, run php artisan filament:cache-components (if you use component caching) and php artisan config:clear — stale cached components are the most common "the package update did nothing" report.->native() gives better mobile UX but disables the searchable dropdown; with 250 options, a non-native searchable select is the better default on desktop, and the reverse on mobile.->searchable()->preload() applied once) rather than repeating them in every form. If you need different labels, prefer a custom field class over monkey-patching the package's translation files — package-level lang files are overwritten on update.How can I help you explore Laravel packages today?