witness-data/filament-country

A feature rich country select field, including flags, based on ISO 3166-1.

Maintainers

Package info

github.com/witness-data/filament-country

pkg:composer/witness-data/filament-country

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-08-24 18:41 UTC

This package is auto-updated.

Last update: 2026-08-24 19:19:35 UTC


README

FilamentCountry provides a CountrySelect component, for use in forms.

This plugin provides a searchable select field that displays country flags and names. The selected country is stored using the ISO 3166-1 alpha-2 code.

Screenshot

Installation

First require the library.

composer require witness-data/filament-country

Then update your dependencies.

composer update

Usage

Prepare model:

First prepare your Eloquent model by casting the country field(s).

use WitnessData\FilamentCountry\Country;

protected $casts = [
    'birth_country' => Country::class,
];

Form schema:

You may use the CountrySelect field in your form's schema the same as any other Filament field.

use WitnessData\FilamentCountry\CountrySelect;

$schema->components([
    CountrySelect::make('birth_country'),
])

You can turn off the flag emojis to display just the country names.

use WitnessData\FilamentCountry\CountrySelect;

$schema->components([
    CountrySelect::make('birth_country')
        ->displayFlagEmojis(false),
])

The CountrySelect can be modified using any of the functions used to customize a standard Filament Select. You can inject classes as normal.

use WitnessData\FilamentCountry\CountrySelect;

CountrySelect::make('birth_country')
    ->searchable(false)
    ->label(fn (?Model $record): string => $record->first_name . '\'s country of birth'),

Infolist schema:

You may use a standard TextEntry to display country data in your infolist, assuming it is cast properly in your model.

$schema->components([
    TextEntry::make('birth_country')
])