mohammadhprp / filament-ip-to-country-flag-column
Display Country flag from IP address in your Filament tables
Package info
github.com/mohammadhprp/filament-ip-to-country-flag-column
pkg:composer/mohammadhprp/filament-ip-to-country-flag-column
Requires
- php: ^8.2
- ext-curl: *
- filament/support: ^5.0
- filament/tables: ^5.0
- livewire/livewire: ^4.1
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^10.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-16 07:44:28 UTC
README
Installation
Requires Filament 5 and PHP 8.2 or newer.
composer require mohammadhprp/filament-ip-to-country-flag-column
Usage
use Mohammadhprp\IPToCountryFlagColumn\Columns\IPToCountryFlagColumn; IPToCountryFlagColumn::make('client_ip');
Options
flagPosition('left')- flag position,right(default) orleft.location(position: 'above', separator: '-')- location position,below(default) orabove, and separator (default,).hideIP(),hideFlag(),hideLocation(),hideCountry(),hideCity().locationResolver(fn (string $ip): array => [...])- use another provider, add caching, or point at a self-hosted service. The package never caches lookups itself.whenVisible()- resolve a cell only once it scrolls into view.loadingState('Locating…')anderrorState('Unavailable')- what a cell shows while loading and when a lookup fails (they accept a string, anHtmlable, or a closure). Failed cells are clickable to retry; disable withretryable(false). UseerrorStateUsing(fn (Throwable $exception) => ...)if you need the exception.
Testing
composer test
Example Application
The example/ directory contains a Laravel 12 and Filament 5 application using
this package through a local Composer path repository. See
example/README.md for setup and login instructions.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
- Fork the repository.
- Create a new branch for your feature.
- Make your changes and commit them with clear commit messages.
- Submit a pull request to the
masterbranch.
Credits
License
This project is licensed under the MIT License - see the License file for details.
