Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Filament Country Code Field

Filament Country Code Field Laravel Package

tapp/filament-country-code-field

A country code select form field, table column, and table filter for Laravel Filament. Easily add searchable country codes to your resources' forms and tables, with a publishable config file. Supports Filament 4.x and 5.x.

View on GitHub
Deep Wiki
Context7

Filament country code field.

Frequently asked questions about Filament Country Code Field
How do I install tapp/filament-country-code-field in a Laravel Filament app?
Install it with Composer using composer require tapp/filament-country-code-field:"^2.0". Optionally publish the config file with php artisan vendor:publish --tag="filament-country-code-field-config". There are no service provider settings, environment variables, queue workers, or asset build steps to configure, so installation is effectively one command.
Which Filament versions does this country code field support?
Version 2.x of the package targets Filament 4.x and 5.x, while version 1.x covers Filament 3.x and keeps its own documentation branch. Pick the package major that matches the Filament major already running in your panel. Note that 2.x drops PHP 8.2 support and adds PHP 8.5, so check your PHP constraint before upgrading.
How do I add a country code select field to a Filament form?
Use the CountryCodeSelect component inside your resource schema. Add use Tapp\FilamentCountryCodeField\Forms\Components\CountryCodeSelect; and then place CountryCodeSelect::make('country_code') in the form schema array. It is a searchable select that extends Filament's own field class, so normal state handling and validation rules still apply.
How do I display a country code in a Filament table column?
Add the CountryCodeColumn to your table columns. Import Tapp\FilamentCountryCodeField\Tables\Columns\CountryCodeColumn and call CountryCodeColumn::make('country_code') inside the columns array. It renders a clean, consistent representation instead of the raw stored dialing code string.
How do I filter a Filament table by country code?
Use the CountryCodeSelectFilter in the filters array of your table. Import Tapp\FilamentCountryCodeField\Tables\Filters\CountryCodeSelectFilter and add CountryCodeSelectFilter::make('country_code') to the filters. Because it extends Filament's base filter class, it participates in the standard query pipeline for your resource.
Do I need to publish the config file, and can I customize the country list or labels?
Publishing the config is optional but recommended if you want to adjust package behavior; use the filament-country-code-field-config tag. Be aware that the README does not document the individual config keys or provide a customization guide for label formatting, flag rendering, or searchable lists, so read the published config file itself before changing values. Pin the version and re-check the config after each upgrade.
Does the package create a database column or migration for country_code?
No. The package is storage-agnostic and ships no migration or model trait, so persistence stays whatever your application already does with that column. Adding or removing the field only changes the UI in the resources that opt in, which means adoption is a presentation decision rather than a schema decision.
How do I test a Filament form that uses CountryCodeSelect?
Write a standard Filament feature test that mounts the form, fills the country_code field, submits, and asserts the expected value is saved. Also assert that the column and filter render for records with a null country code, since empty-state handling is a known edge path. The package repository itself ships GitHub Actions test and Pint workflows, which is a reasonable quality signal for a small package.
Is tapp/filament-country-code-field safe to use in production?
The risk is low severity: the package performs no database writes, authentication, external network calls, background processing, or PII handling, so the worst realistic failure is a broken select rendering on a form. The main caveats are adoption and maintenance, since the project is small with few dependents and bus factor of roughly one to two maintainers, and its release cadence follows Filament majors. Because it registers front-end styles into your panel, pin the version and run a visual check after each bump.
What are the alternatives to this Filament country code package?
The direct alternative is Filament's built-in Select populated from your own country dialing code array, which avoids a third-party dependency but leaves flag rendering, labeling, and filter consistency to you. You could also build a small internal field, column, and filter trio once and reuse it across resources. This package mainly saves the wiring and keeps the display consistent, so evaluate it on how much you value that convenience versus owning the code.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package