Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Blade Icon Generation Helpers Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Blade Icon Generation Helpers

A helper package to convert the icons to make it compatible to be used with the blade-icons package.

Installation

composer require codeat3/blade-icon-generation-helpers

Usage

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:

  • it removes the following attributes from the svg
    • 'width', 'height', 'class', 'style', 'id',
  • if in the config provided is-outline is set as true
    • if fill attribute exists - it will updated to none
    • if stroke attribute exists - it will updated to currentColor
  • if in the config provided is-solid is set as true
    • if fill attribute exists - it will updated to currentColor
  • if in the config provided custom-attributes is set`
    • it will set the attributes to the svg
  • optionally it provides 2 callable methods pre & post
    • both callback receives the $svgEL as the DOMDocument - its the DOMDocument instance of the current icon
    • pre can be used if you have to perform some operation before Processor does the default processing
    • post can be used if you have to perform some operation after Processor does the default processing

The save method

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views