Install the package via composer
composer require wrdx/heroicons
use Wrdx\Heroicons\Hero;
echo Hero::icon('academic-cap')->svg();
A bit more control
use Wrdx\Heroicons\Hero;
use Wrdx\Heroicons\Enums\Type;
$icon = new Hero('academic-cap');
$icon->type(Type::micro);
$icon->class('my-class', 'my-second-class');
$icon->attr('id','my-id');
echo $icon->svg();
Use the heroicon()
helper function
use Wrdx\Heroicons\Enums\Type;
echo heroicon('academic-cap', Type::mini, ['id' => 'my-id']);
Run tests
composer test
Update heroicons.com svg files
composer heroicons:update