PHP code example of adrianmomorales / blade-svg-sage9-php8

1. Go to this page and download the library: Download adrianmomorales/blade-svg-sage9-php8 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/ */

    

adrianmomorales / blade-svg-sage9-php8 example snippets




return [
    // ...
    'class' => 'icon', // Add the `icon` class to every SVG when rendered
    // ...
];



return [
    // ...
    'class' => 'icon inline-block',
    // ...
];



return [
    // ...
    'spritesheet_path' => 'resources/assets/svg/spritesheet.svg',
    // ...
];



return [
    // ...
    'sprite_prefix' => 'zondicon-',
    // ...
];



return [
    // ...
    'inline' => false,
    // ...
];

php artisan vendor:publish --provider="BladeSvg\BladeSvgServiceProvider"
html
<a href="/settings">
    @svg('cog', 'icon-lg') Settings
</a>

<!-- Renders.. -->
<a href="/settings">
    <svg class="icon icon-lg">
        <path d="..." fill-rule="evenodd"></path>
    </svg>
    Settings
</a>
html
<a href="/settings">
    @svg('cog', ['class' => 'overridden']) Settings
</a>

<!-- Renders.. -->
<a href="/settings">
    <svg class="overridden">
        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#zondicon-cog"></use>
    </svg>
    Settings
</a>