June 30, 2017
I liked it that much that I wrote a little composer package that brings the two together and allows you to use the
@svg() directive inside your WordPress page templates. It assumes that you place your icons inside a
resources/assets/icons directory in your theme directory and you can start using it straight away.
<!-- This... --> <a href="/settings"> @svg('cog', 'icon-lg') Settings </a> <!-- Renders this! --> <a href="/settings"> <svg class="icon icon-lg" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <!-- ... --> </svg> </a>
The majority of the credit for this goes to Adam Wathan for his awesome work on the blade svg directive and for more advanced usage you can check out his repository.