abetwothree/laravel-iconify-api
Laravel Iconify API brings the full Iconify icon library to your Laravel app. Search and fetch thousands of open-source icons through a simple, configurable API client, then render them in Blade or pass them to your frontend. Lightweight, framework-friendly, and easy to set up.
composer require abetwothree/laravel-iconify-api; the service provider and Iconify facade are auto-discovered, so there's no manual registration step in a standard Laravel skeleton.php artisan vendor:publish --tag=iconify-config (check the README for the exact tag in v1.5.x). The config holds the API base URL/host, HTTP timeout, cache store + TTL, and the providers array.config/iconify.php, the facade class (to see the real method signatures), then the provider/client class that builds requests. Most surprises come from config defaults, not from the methods.IconService (or a Icon value object) that resolves names, applies fallbacks, and returns a typed DTO. Iconify's payload shape is verbose; normalizing it once keeps controllers and Blade clean and gives you a single place to change when the upstream API shifts.<x-icon name="mdi:home" /> component that calls your service and emits {!! $svg !!} is the highest-leverage integration. Add aria-hidden/role="img" and a $attributes merge so it composes with Tailwind classes.Cache::remember("iconify:{$prefix}:{$name}", $ttl, ...). Icon data is effectively immutable for a given set version, so a long TTL (days) with a scheduled flush is usually right. Keys must include the provider name once you configure more than one.providers with its own base URL and prefix, then resolve icons with that prefix. Keep provider definitions in config, not in code, so per-environment hosts differ cleanly.throttle middleware) rather than calling the facade from the browser-facing route directly — you get validation, prefix whitelisting, and rate limiting for free.Http::fake() the Iconify endpoints in your test suite; assert on the cached path too. Never let CI hit the live API.declare(strict_types=1) package-wide. This is the one upgrade risk. If you extend any package class or implement an interface from it, your overrides must now match parameter and return types exactly — loose coercion that previously passed will throw TypeError. Run your suite against 1.5.1 before shipping; if you only consume the facade, the upgrade is a no-op.providers entries were silently falling back to the default host (or resolving the wrong base URL), that's the fix. Re-test multi-provider setups after upgrading rather than assuming prior behaviour.@foreach will stall the whole response. Set a short connect/read timeout in config and make your service fail soft.mdi:home from provider A and serving it for provider B. Prefix keys with the provider name.php artisan config:cache snapshots your config — don't call env() from application code, and remember to re-run it after changing provider hosts.{!! !!} is required, so treat the source as trusted. If a custom provider base URL is operator-configurable, sanitize the payload; don't let untrusted SVG through.prefixes you search and cap result counts; unbounded searches across all Iconify sets are slow and hit rate limits.How can I help you explore Laravel packages today?