PHP code example of enuenan / font-awesome-blade

1. Go to this page and download the library: Download enuenan/font-awesome-blade 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/ */

    

enuenan / font-awesome-blade example snippets




return [

    /*
    |--------------------------------------------------------------------------
    | Rendering Mode
    |--------------------------------------------------------------------------
    | webfonts = classic <i class="fa-...">
    | svg      = inline SVG rendering
    */
    'mode' => 'webfonts',

    /*
    |--------------------------------------------------------------------------
    | Defaults
    |--------------------------------------------------------------------------
    */
    'default_style' => 'solid',
    'default_family' => 'classic',

    /*
    |--------------------------------------------------------------------------
    | Allowed Styles
    |--------------------------------------------------------------------------
    */
    'allowed_styles' => [
        'solid',
        'regular',
        'brands',
    ],

    /*
    |--------------------------------------------------------------------------
    | Allowed Families
    |--------------------------------------------------------------------------
    */
    'allowed_families' => [
        'classic',
        'sharp',
    ],

    /*
    |--------------------------------------------------------------------------
    | Auto Inject CSS
    |--------------------------------------------------------------------------
    */
    'auto_inject' => true,

    /*
    |--------------------------------------------------------------------------
    | SVG Mode Settings
    |--------------------------------------------------------------------------
    */
    'svg' => [
        'disk' => 'local',
        'path' => 'vendor/font-awesome-blade/svgs',
        'cache' => true,

        'download' => [
            'ref' => '7.x',
            'styles' => ['brands', 'solid', 'regular'],
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Premium (Reserved)
    |--------------------------------------------------------------------------
    */
    'premium' => [
        'enabled' => false,
        'license_key' => env('FA_BLADE_LICENSE_KEY'),
        'allow_pro_styles' => false,
    ],
];

'mode' => 'svg',

'auto_inject' => false,

use Enuenan\FontAwesomeBlade\FontAwesomeBlade;

$fa = app(FontAwesomeBlade::class);

$classes = $fa->classes('user', 'solid');

$html = $fa->tag('check', [
    'class' => 'text-green-600',
    'aria-label' => 'Success',
]);
bash
php artisan vendor:publish --tag="font-awesome-blade-config"

config/font-awesome-blade-user.php
blade
<x-fa icon="user" />
blade
<x-fa icon="user" style="regular" />
<x-fa icon="github" style="brands" />
blade
<x-fa icon="user" size="lg" />
<x-fa icon="user" size="2x" />
<x-fa icon="user" size="5x" />
bash
php artisan fa:download-svgs
bash
php artisan fa:download-svgs --styles=solid,regular
bash
php artisan fa:download-svgs --force