- How do I install and set up artisanpack-ui/icons in a Laravel 13 project?
- Run `composer require artisanpack-ui/icons`, then publish the config with `php artisan vendor:publish --tag=artisanpack-package-config`. Organize your SVGs in `resources/icons/` and define paths/prefixes in `config/artisanpack/icons.php`. No additional dependencies beyond Blade Icons are required.
- Can I use this package with Laravel Livewire components?
- Yes, the package explicitly supports Livewire UI components. Icons registered via config or events will work seamlessly in dynamic Livewire components, including real-time updates without re-renders.
- What Laravel versions and PHP requirements does this package support?
- The package is compatible with Laravel 12 and 13 and requires PHP 8.2+. It aligns with Laravel’s LTS support, ensuring long-term stability and security updates.
- How do I register custom icon sets dynamically at runtime?
- Use the `ap.icons.register-icon-sets` event in a service provider’s `boot()` method. Pass an array of icon set configurations with `path` and `prefix` keys. This is ideal for package developers or dynamic icon loading.
- Will this package work with Font Awesome Pro or other premium icon sets?
- Absolutely. The package is designed for premium icon sets like Font Awesome Pro. Simply configure the SVG paths in `config/artisanpack/icons.php` and use the `<x-icon-* />` syntax with the set’s prefix.
- How does this package handle missing or corrupted SVG files?
- The package logs warnings for missing or corrupted SVGs but won’t break your application. Blade templates will render gracefully, and you can customize error handling via the `ap.icons.missing-icon` event.
- Can I integrate this with Vite or Laravel Mix for asset optimization?
- Yes, SVGs stored in `resources/icons/` are treated as static assets. They’ll be processed by your existing asset pipeline (Vite, Laravel Mix, or static file serving) without additional configuration.
- What are the performance implications of registering multiple icon sets?
- The package is optimized for performance with lazy-loading SVGs and zero hardcoded icons. Memory overhead remains minimal even with dozens of icon sets, making it ideal for dashboards or admin panels.
- How do I avoid icon naming collisions between custom and third-party sets?
- Use unique prefixes for each icon set (e.g., `fa`, `hero`, `brand`). The package enforces prefix validation during registration, and the Blade component syntax (`<x-icon-{prefix}-{name} />`) ensures no conflicts.
- Are there alternatives to this package for custom SVG icons in Laravel?
- Alternatives include hardcoding SVGs in Blade or using standalone packages like `laravel-svg`. However, this package offers a cleaner, more scalable solution with config/event-driven registration, Livewire support, and built-in Blade Icons integration.