• IP to country flag 🚩

IP to country flag 🚩

Plugin information

by Mohammadhprp

Admin panel Column

Display country flag from IP address in your Filament tables

Support

#ip-to-country-flag on Discord

Views

578

License

MIT

Documentation

image

Warning: This plugin may cause a slight delay in page loading due to API calls to iplocation.

Installation

You can install the package via composer:

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

Usage

To use the package, follow these steps:

use Mohammadhprp\IPToCountryFlagColumn\Columns\IPToCountryFlagColumn;
 
IPToCountryFlagColumn::make('client_ip');

Options

  1. Flag position: Change the position of the flag using flagPosition. Available options: right and left.

    IPToCountryFlagColumn::make('client_ip')->flagPosition('left');

    💡 Note: Default flag position is right.

  2. Hide flag: Hide the flag using hideFlag.

    IPToCountryFlagColumn::make('client_ip')->hideFlag();
  3. Location position: Change the location position using location(). Available options: below and above.

    IPToCountryFlagColumn::make('client_ip')->location(position: 'above');

    💡 Note: Default location position is below.

  4. Location separator: Change the location separator using location().

    IPToCountryFlagColumn::make('client_ip')->location(separator: '-');

    💡 Note: Default location separator is ,.

  5. Hide city or country name: Hide city or country name using hideCity() or hideCountry().

    IPToCountryFlagColumn::make('client_ip')
    ->hideCountry()
    ->hideCity();