spatie/laravel-google-fonts
Self-host Google Fonts in Laravel with minimal setup. Register Google Fonts CSS URLs in config and load them via the @googlefonts Blade directive. On first request it downloads CSS/assets, caches locally, inlines CSS, and falls back to Google if needed.
Look Elsewhere If:
Adopt If:
google-fonts:fetch command) for zero-runtime overhead."This package lets us self-host Google Fonts in Laravel, cutting external dependencies that slow down our site and expose users to third-party tracking. By caching fonts locally, we’ll see faster load times (improving SEO and conversions) and better compliance with privacy regulations—all with minimal dev effort. The upfront cost is negligible (MIT license, open-source), and the long-term savings in bandwidth and performance are significant, especially for high-traffic pages. It’s a no-brainer for our [performance/privacy/compliance] goals."
Key Metrics to Track:
*"This package solves self-hosting Google Fonts with Laravel in three steps:
config/google-fonts.php (e.g., Inter, IBM Plex Mono).php artisan google-fonts:fetch to pre-download fonts to storage/app/public/fonts.@googlefonts directives—it handles CSS inlining, preloading, and fallbacks automatically.Why It’s Great for Us:
spatie/laravel-csp).Tradeoffs:
user_agent config tweak if needed.Next Steps:
composer.json (spatie/laravel-google-fonts).config/google-fonts.php.php artisan storage:link and google-fonts:fetch in CI/CD.Alternatives Considered:
Recommendation: Adopt. This is a battle-tested, low-maintenance solution for our Laravel stack."*
How can I help you explore Laravel packages today?