PHP code example of agatanga / flags

1. Go to this page and download the library: Download agatanga/flags library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

agatanga / flags example snippets


// 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'])

// 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']) }}
bash
php artisan vendor:publish --provider="Agatanga\Flags\FlagsServiceProvider"
vi config/flags.php