- How do I install and set up filament-phosphor-icons in a Laravel Filament 4/5 project?
- Run `composer require tonegabes/filament-phosphor-icons` and use the `Phosphor` enum directly in Filament components. No extra configuration is needed—just replace your existing icon calls (e.g., `Action::make()->icon(Phosphor::StarBold)`). The package integrates seamlessly with Filament’s built-in icon system.
- Does this package work with Filament 5, or is it only for Filament 4?
- This package supports **both Filament 4 and 5** with minimal version-specific logic. It relies on `filament/support v2.x+`, which is compatible with both major versions. Check the [Filament docs](https://filamentphp.com/docs) for your version to ensure smooth integration.
- Will using Phosphor Icons increase my bundle size significantly?
- Phosphor offers 2,000+ icons, but you can **lazy-load or tree-shake unused icons** if using Vite/Webpack. The package itself is lightweight (only requires `filament/support`), and you can manually prune unused enums to optimize bundle size. Test with tools like Webpack Bundle Analyzer if concerned.
- Can I customize icon weights (e.g., bold, fill) globally or per-component?
- Yes! The package includes a `Weight` enum for dynamic styling. Use `Phosphor::Star->forceWeight(Weight::Fill)` per-component or override defaults globally via config. The README shows examples for both approaches, ensuring flexibility for theming.
- How do I handle missing or custom Phosphor icons not included in the package?
- The package covers the most popular Phosphor icons, but you can extend it by adding custom enums or using the `forceWeight()` method for unsupported variants. For missing icons, default to a placeholder (e.g., `Phosphor::Question`) or create a PR to expand the package’s coverage.
- Are there performance concerns with enums in large-scale Filament apps?
- Enums are lightweight, but runtime reflection (e.g., `Phosphor::cases()`) could impact performance if overused. Benchmark in apps with **>100 icons per view**—most use cases won’t notice a difference. The package avoids heavy DOM manipulation, so Filament’s rendering remains efficient.
- How do I test filament-phosphor-icons in my Laravel project?
- Test with PHPUnit by mocking `Phosphor` enum values (e.g., `Phosphor::StarBold->value`). For integration tests, verify icons render correctly in Filament’s `Action`, `Toggle`, and `IconColumn` components. Use Filament’s built-in testing helpers to simulate dark/light mode rendering.
- Can I use filament-phosphor-icons with Tailwind CSS without conflicts?
- Yes, Phosphor icons are SVG-based and work natively with Tailwind. Ensure you don’t override `filament/support`’s default icon styles (e.g., avoid `!important` conflicts). The package’s icons use scoped SVG classes (e.g., `i-phosphor-star`), so styling leaks are minimal.
- What’s the migration path if I’m switching from Font Awesome/Heroicons to Phosphor?
- Audit your existing icon usage (e.g., `heroicon('star')`) and map them to Phosphor equivalents (e.g., `Phosphor::Star`). Start with a pilot integration in one Filament resource/page, then roll out globally. The package’s enum structure makes replacements straightforward.
- Are there alternatives to filament-phosphor-icons for Filament icon sets?
- Yes, alternatives include `filament-spatie-laravel-icons` (for Spatie icons) or manually integrating other icon sets via SVG files. However, this package is **optimized for Filament 4/5**, offering native enum support, weights, and lazy-loading—unlike generic icon packages that require extra setup.