mohammadhprp/filament-ip-to-country-flag-column

Display Country flag from IP address in your Filament tables
19,767 24
Install
composer require mohammadhprp/filament-ip-to-country-flag-column
Latest Version:v2.2.0
PHP:^8.2
License:MIT
Last Updated:Sep 16, 2026
Links: GitHub  ·  Packagist
Maintainer: mohammadhprp

IP to country flag Column for Filament 🚩

License Latest Version on Packagist Total Downloads Plumb score

image

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) or left.
  • location(position: 'above', separator: '-') - location position, below (default) or above, 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…') and errorState('Unavailable') - what a cell shows while loading and when a lookup fails (they accept a string, an Htmlable, or a closure). Failed cells are clickable to retry; disable with retryable(false). Use errorStateUsing(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

  1. Fork the repository.
  2. Create a new branch for your feature.
  3. Make your changes and commit them with clear commit messages.
  4. Submit a pull request to the master branch.

Credits

License

This project is licensed under the MIT License - see the License file for details.

Related Packages