codeat3/blade-icon-generation-helpers
Laravel package that adds helper directives and utilities to generate Blade icon components quickly. Streamlines converting icon sets into reusable Blade components, reducing boilerplate and keeping icon usage consistent across your views.
A helper package to convert the icons to make it compatible to be used with the blade-icons package.
composer require codeat3/blade-icon-generation-helpers
Kindly refer the Generating Icons section from Blade Icons. This Package utilizes the after callback to process the icons as per our need.
The after callback received 3 arguments string $icon - this is the pathname of the icon, array $config - the config specified in the generation.php & SplFileInfo $file - the original icon file instance.
Inside a callback we instantiate our Processor class & use its helper methods to our benefit.
$iconProcessor = new IconProcessor($icon, $config, $sourceFile);
This IconProcessor instance itself does some optimization on its own by default. Minimal usage would be as follows.
$iconProcessor = new IconProcessor($icon, $config, $sourceFile);
$iconProcessor
->optimize()
->save();
The optimize method does the following things by default:
is-outline is set as true
fill attribute exists - it will updated to nonestroke attribute exists - it will updated to currentColoris-solid is set as true
fill attribute exists - it will updated to currentColorcustom-attributes is set`
pre & post
$svgEL as the DOMDocument - its the DOMDocument instance of the current iconpre can be used if you have to perform some operation before Processor does the default processingpost can be used if you have to perform some operation after Processor does the default processingThe save method
How can I help you explore Laravel packages today?