mohammadhprp / filament-ip-to-country-flag-column
Display Country flag from IP address in your Filament tables
Installs: 8 085
Dependents: 0
Suggesters: 0
Security: 0
Stars: 14
Watchers: 1
Forks: 4
Open Issues: 1
Requires
- php: ^8.1
- ext-curl: *
- filament/tables: ^3.0-stable
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^7.0|^8.0
- phpunit/phpunit: ^9.5|^10.0
README
Display country flag from IP address in your Filament tables
Warning This plugin may cause a slight delay in page loading due to API calls to iplocation.
Screenshot
Installation
You can install the package via composer:
composer require mohammadhprp/filament-ip-to-country-flag-column
For Filament v2:
composer require mohammadhprp/filament-ip-to-country-flag-column:"^0.2.0"
Usage
To use the package, follow these steps:
use Mohammadhprp\IPToCountryFlagColumn\Columns\IPToCountryFlagColumn; IPToCountryFlagColumn::make('client_ip');
Options
-
Flag position: Change the position of the flag using
flagPosition
. Available options:right
andleft
.IPToCountryFlagColumn::make('client_ip')->flagPosition('left');
💡 Note: Default flag position is
right
. -
Hide flag: Hide the flag using
hideFlag
.IPToCountryFlagColumn::make('client_ip')->hideFlag();
-
Location position: Change the location position using
location()
. Available options:below
andabove
.IPToCountryFlagColumn::make('client_ip')->location(position: 'above');
💡 Note: Default location position is
below
. -
Location separator: Change the location separator using
location()
.IPToCountryFlagColumn::make('client_ip')->location(separator: '-');
💡 Note: Default location separator is
,
. -
Hide city or country name: Hide city or country name using
hideCity()
orhideCountry()
.IPToCountryFlagColumn::make('client_ip') ->hideCountry() ->hideCity();
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
master
branch.
Credits
License
This project is licensed under the MIT License - see the License file for details.