Skip to content
/ flags Public

Country flags in SVG format for Laravel application.

License

Notifications You must be signed in to change notification settings

agatanga/flags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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