Monthly Archives: March 2019

Laravel SVG directive

I was working on a site and uses Steve Schoger‘s Heroicons. The Heroicons are svg based and it works best with SVG using HTML inline.

I wrote a custom blade directive so that I can include the inline SVG easily with blade directive.


When I need to use a Heroicons svg, I just need to call it with

@svg('heroicon-user-plus-sm')

given that the svg file is already copied into public/svg directory.

Advertisements