A country code select form field, table column, and table filter for Laravel Filament.
Filament | Filament Country Code Field |
---|---|
3.x | 1.x |
4.x | 2.x |
You can install the package via Composer:
composer require tapp/filament-country-code-field:"^1.0"
composer require tapp/filament-country-code-field:"^2.0"
You can publish the config file with:
php artisan vendor:publish --tag="filament-country-code-field-config"
Add to your Filament resource:
use Tapp\FilamentCountryCodeField\Forms\Components\CountryCodeSelect;
public static function form(Form $form): Form
{
return $form
->schema([
// ...
CountryCodeSelect::make('country_code'),
// ...
]);
}
use Tapp\FilamentCountryCodeField\Tables\Columns\CountryCodeColumn;
public static function table(Table $table): Table
{
return $table
->columns([
//...
CountryCodeColumn::make('country_code'),
])
// ...
}
use Tapp\FilamentCountryCodeField\Tables\Filters\CountryCodeSelectFilter;
public static function table(Table $table): Table
{
return $table
//...
->filters([
CountryCodeSelectFilter::make('country_code'),
// ...
])
}