agatanga / flags
Country flags in SVG format for Laravel application.
Installs: 29 680
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: ^7.3|^8.0
- illuminate/contracts: ^7.14|^8.0|^9.0|^10.0|^11.0
- illuminate/filesystem: ^7.14|^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^7.14|^8.0|^9.0|^10.0|^11.0
- lipis/flag-icons: ^6.8|^7.0
README
Country flags in SVG format for your Laravel application. Uses lipis/flag-icons icons under the hood.
Installation
composer require agatanga/flags
Usage
Directive
// Render flag using default ratio: @flag('us') // Tell what ratio to use, which classes, and attributes to add to the svg element: @flag('us:1x1', 'w-64', ['id' => 'flag-us'])
Helper
// Render flag using default ratio: {{ flag('us') }} // Tell what ratio to use, which classes, and attributes to add to the svg element: {{ flag('us:1x1', 'w-64', ['id' => 'flag-us']) }}
Configuration
You may configure the default ratio to use, and default css classes to add:
php artisan vendor:publish --provider="Agatanga\Flags\FlagsServiceProvider"
vi config/flags.php
Credits
- lipis/flag-icons - Wonderful SVG flags.
- blade-ui-kit/blade-icons - Code and Idea.