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 Hugeicons Laravel Package

afatmustafa/blade-hugeicons

View on GitHub
Deep Wiki
Context7
## Getting Started
Install via Composer:
```bash
composer require afatmustafa/blade-hugeicons

Publish the SVG assets (if needed) and configure via config/hugeicons.php. The package now uses Hugeicons Free v4 by default. Test basic usage with:

@hugeicon('container')  <!-- Now renders correctly with strokes -->

Verify older icons (e.g., container-truck) still work. Clear Blade cache after installation:

php artisan view:clear

Implementation Patterns

1. Blade Directive Integration

Use @hugeicon('icon-name') directly in Blade templates. For dynamic icons, pass variables:

@hugeicon($dynamicIconName)

2. SVG Customization

Override default SVG attributes via config:

'hugeicons' => [
    'default_attributes' => [
        'class' => 'text-blue-500',
        'width' => '24',
        'height' => '24',
    ],
],

3. Caching Optimization

Enable caching for performance (recommended for production):

'hugeicons' => [
    'cache' => true, // Default: false
],

Clear cache after updates:

php artisan view:clear

4. Custom SVG Paths

Extend the package by publishing SVGs and modifying resources/svg:

php artisan vendor:publish --tag=hugeicons-assets

Gotchas and Tips

Breaking Changes in v2.0.1

  • Stroke Visibility Fix: Icons like container now render correctly, but older configs relying on fill="currentColor" may need adjustment. Explicitly set fill="none" in custom SVGs if strokes disappear.
  • Cache Invalidation: Always run php artisan view:clear after upgrading to v2.0.1.

Debugging Tips

  1. Blank Icons? Check if the SVG file exists in resources/svg (or published assets). Verify the icon name matches the filename (e.g., container.svg).

    ls resources/svg | grep container
    
  2. Stroke Issues Ensure the root <svg> tag includes fill="none" (added in v2.0.1). Override via config if needed:

    'default_attributes' => ['fill' => 'none'],
    
  3. Performance Disable caching ('cache' => false) during development to see real-time changes.

Extension Points

  • Add New Icons: Copy existing SVGs from Hugeicons Free v4, rename them, and place them in resources/svg. Update Blade usage accordingly.
  • Theme Support: Use CSS variables or inline styles to dynamically theme icons:
    @hugeicon('container', ['style' => 'color: var(--icon-color)'])
    

NO_UPDATE_NEEDED (for prior assessments; this is a **full replacement** due to breaking changes and new patterns).
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.
codifyo/ts-generator-bundle
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