agatanga/flags

Country flags in SVG format for Laravel application.
51,356 7
Install
composer require agatanga/flags
Latest Version:1.3.0
PHP:^7.3|^8.0
License:MIT
Last Updated:May 26, 2026
Links: GitHub  ·  Packagist
Maintainer: vovayatsyuk

Flags

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

Related Packages

outhebox/blade-flags

A package to easily make use of country & language flags in your Laravel Blade v...

1,043,332 312
log1x/blade-svg-sage

Composer package to add support for Blade SVG by Adam Wathan to Roots Sage.

79,966 74
rinvex/countries

Rinvex Countries is a simple and lightweight package for retrieving country deta...

8,799,814 1,743
blade-ui-kit/blade-icons

A package to easily make use of icons in your Laravel Blade views.

55,803,576 2,488
clntdev/blade-payment-icons

Laravel Blade components for SVG credit card and payment icons

2,093 0

Version History

Version Released PHP Laravel License
1.3.0 ^7.3|^8.0 ^7.14|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0 MIT
1.2.0 ^7.3|^8.0 ^7.14|^8.0|^9.0|^10.0|^11.0|^12.0 MIT
1.1.0 ^7.3|^8.0 ^7.14|^8.0|^9.0|^10.0|^11.0 MIT
1.0.10 ^7.3|^8.0 ^7.14|^8.0|^9.0|^10.0|^11.0 MIT
1.0.9 ^7.3|^8.0 ^7.14|^8.0|^9.0|^10.0 MIT