whatwedo/twig-bootstrap-icons
Twig Integration for Bootstrap Icons. This bundle is inspred by marcw/twig-heroicons.
composer require whatwedo/twig-bootstrap-icons
Just register the extension
$twig->addExtension(new BootstrapIconsExtensions());
// bundles.php
return [
whatwedo\TwigBootstrapIcons\whatwedoTwigBootstrapIconsBundle::class => ['all' => true],
];
Outputs the SVG
{{ bootstrap_icon('alarm') }}
you can pass an array as second argument to add attributes to the <svg>-tag:
{{ bootstrap_icon('alarm', {
class: 'text-gray-500 mr-3 h-6 w-6'
alt: 'alarm clock'
}) }}
How can I help you explore Laravel packages today?