marvinrabe/blade-flags

A package to easily make use of country flags in your Laravel Blade views.
1,165
Install
composer require marvinrabe/blade-flags
Latest Version:7.5.0
PHP:^8.0
License:MIT
Last Updated:Jul 17, 2026
Links: GitHub  ·  Packagist
Maintainer: marvinrabe

Blade Flags

Latest Version on Packagist GitHub Tests Action Status Total Downloads

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

For a full list of available flags see the SVG directory or preview them at flag-icons. Flag SVGs are provided by lipis/flag-icons.

Requirements

  • PHP 8.0 or higher
  • Laravel 9.0 or higher

Installation

composer require marvinrabe/blade-flags

Blade Icons

Blade Flags uses Blade Icons under the hood. Please refer to the Blade Icons readme for additional functionality. We also recommend to enable icon caching with this library.

Configuration

Blade Flags also offers the ability to use features from Blade Icons like default classes, default attributes, etc. If you'd like to configure these, publish the blade-flags.php config file:

php artisan vendor:publish --tag=blade-flags-config

Usage

Icons can be used as self-closing Blade components which will be compiled to SVG icons:

<x-flag-4x3-us/>

You can also pass classes to your icon components:

<x-flag-4x3-us class="w-6 h-6"/>

And even use inline styles:

<x-flag-4x3-us style="color: #555"/>

Or use the @svg directive:

@svg('flag-4x3-us', 'w-6 h-6', ['style' => 'color: #555'])

Flags are available in two aspect ratios. The 4x3 flags:

<x-flag-4x3-us/>
<x-flag-4x3-de/>
<x-flag-4x3-fr/>

And the 1x1 (square) flags:

<x-flag-1x1-us/>
<x-flag-1x1-de/>
<x-flag-1x1-fr/>

Raw SVG Icons

If you want to use the raw SVG icons as assets, you can publish them using:

php artisan vendor:publish --tag=blade-flags --force

Then use them in your views like:

<img src="{{ asset('vendor/blade-flags/4x3-us.svg') }}" width="10" height="10"/>

Credits

License

Blade Flags is open-sourced software licensed under the MIT license.

Related Packages

agatanga/flags

Country flags in SVG format for Laravel application.

50,529 7
outhebox/blade-flags

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

1,007,324 311
philo/laravel-blade

Use the simple and yet powerful Laravel Blade templating engine as a standalone...

687,029 354
jeroennoten/laravel-adminlte

Easy AdminLTE v4 integration with Laravel

5,332,381 4,000
igaster/laravel-theme

Laravel Themes: Asset & Views folder per theme. Theme inheritance. Blade integra...

1,279,271 515