PHP code example of hebinet / laravel-svg-icons

1. Go to this page and download the library: Download hebinet/laravel-svg-icons 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/ */

    

hebinet / laravel-svg-icons example snippets


$icon = new Hebinet\SvgIcons\Icon('fas fa-download');

$iconWithAddClass = new Hebinet\SvgIcons\Icon('fas fa-download fa-5x');

$iconWithTitle = new Hebinet\SvgIcons\Icon('fas fa-download,Download Button');

// You can now render the icon to a string and do what ever you want with it
$svgContent = $icon->render();

$icon = new Hebinet\SvgIcons\Icon();
$svgContent = $icon->render('fas fa-download');

[
    ...

    'Icon' => Hebinet\SvgIcons\Facades\Icon::class,
]

$svgContent = Icon::render('fas fa-check');
bash
php artisan vendor:publish --provider="Hebinet\SvgIcons\ServiceProvider" --tag=config