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 Phosphor Icons

Blade Phosphor Icons Laravel Package

codeat3/blade-phosphor-icons

Use Phosphor Icons in Laravel Blade via simple <x-phosphor-*> components. Built on Blade Icons with support for caching and configurable defaults. Requires PHP 7.4+ and Laravel 8+. Includes v1/v2 Phosphor icon sets and easy upgrades.

View on GitHub
Deep Wiki
Context7

A package to easily make use of Phosphor Icons in your Laravel Blade views.

Frequently asked questions about Blade Phosphor Icons
How do I install and use Phosphor Icons in Laravel Blade?
Run `composer require codeat3/blade-phosphor-icons:^2.0` for Phosphor Icons v2 (or `^1.0` for v1). Use Blade components like `<x-phosphor-alarm/>` or `<x-phosphor-users class='w-6 h-6' />` in your views. The package auto-generates SVG icons on demand.
Does this package support Laravel 13?
Yes, the package explicitly supports Laravel 13 and includes optimizations for modern Laravel features. Check the [release notes](https://github.com/codeat3/blade-phosphor-icons/releases) for compatibility details.
How can I cache icons for better performance?
Run `php artisan icons:cache` during deployment to pre-generate icons. Use Blade’s `@cache` directive for dynamic caching, e.g., `@cache(['tags' => 'dashboard-icons'], 60) @phosphor('users') @endcache`. Refer to the [Blade Icons caching guide](https://github.com/driesvints/blade-icons#caching) for advanced setups.
Can I customize default icon attributes globally?
Yes, publish the config file with `php artisan vendor:publish --tag=blade-phosphor-icons-config` to set defaults like `default_classes`, `default_attributes`, or `icon_set`. This avoids repeating attributes in every Blade component.
What happens if the Phosphor CDN fails in production?
The package includes local SVG assets by default, so icons will still render even if the CDN is unavailable. No additional configuration is needed—fallbacks are handled automatically.
Does this work with Livewire or Inertia.js?
No, this package is Blade-focused and won’t work directly in Livewire/Inertia.js components. For those cases, manually include Phosphor SVGs or use a frontend library like `@phosphor-icons/react`.
How do I upgrade from v1 to v2?
Follow the [upgrade guide](UPGRADE.md) in the repo. Key steps include updating Composer (`^2.0`), clearing Blade cache (`php artisan view:clear`), and testing dynamic icons. The package maintains backward compatibility for most use cases.
Can I use dynamic icon names (e.g., `@phosphor($dynamicIcon)`)?
Yes, dynamic icons are supported, but ensure the variable is sanitized to avoid Blade injection risks. For caching, use `@cache` with unique tags (e.g., `@cache(['tags' => 'user-'.$userId])`) to prevent stale content.
Does this integrate with Vite or Laravel Mix for SVG optimization?
The package outputs inline SVGs, so Vite/Laravel Mix won’t auto-optimize them. For production, manually configure Vite to inline critical icons or lazy-load non-critical ones. HTTP caching (e.g., `Cache-Control: immutable`) for SVG assets is recommended.
Are there alternatives to this package?
For Laravel, alternatives include manually including Phosphor SVGs or using `blade-icons` directly. For broader use, consider `@phosphor-icons/react` (frontend) or `laravel-svg` (for SVG asset management). This package stands out for its Blade integration and caching optimizations.
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope