symfinity/font-manager
Font Manager for Laravel lets you self-host and manage web fonts with a fluent API. Download Google Fonts, generate @font-face CSS, organize families and weights, and serve optimized local assets without external requests. Ideal for privacy-friendly, faster-loading apps.
composer require symfinity/font-manager, then publish the package assets: php artisan vendor:publish --provider="Symfinity\FontManager\FontManagerServiceProvider". This gives you config/font-manager.php plus any publishable CSS/stub views — read the config file first, it is the real documentation for this package.config/font-manager.php (font sets, sources, storage disk, cache TTL), the package README on GitHub (usage examples track the release tag, so browse the v0.2.6 tree rather than main), and CHANGELOG.md — the v0.2.6 notes are a one-line bugfix pointer, so the changelog is the only place to see what actually changed between 0.2.5 and 0.2.6.storage/app/public/fonts or a fonts entry in config/filesystems.php) and expose them via php artisan storage:link. If the CSS is generated with absolute URLs, set APP_URL correctly before your first render or you will bake the wrong host into cached stylesheets.<link> in your layout with self-hosted fonts. Define the family in the config, run the package's download/sync command (check php artisan list for the font namespace), reference the generated stylesheet in your Blade layout, and verify with the Network tab that requests now hit your own domain. That single change covers the two most common motivations for adopting this package: GDPR/third-party-request removal and control over font loading performance.config/font-manager.php and treat that file as the contract. Keep environment-specific values (disk, CDN base URL, cache store) in .env and reference them from the config with env(), so staging and production can point at different storage without code changes.resources/views/partials/fonts.blade.php) that emits both the <link rel="preload"> tags for your critical weights and the @font-face stylesheet. Including it from your base layout keeps font loading in one place instead of scattered across layouts.app.css. Don't do both — duplicate @font-face blocks with different src paths are the most common cause of "the font loads but the wrong weight shows".storage:link and before config:cache, and make it idempotent so repeated deploys don't re-download unchanged files. Follow it with a cache clear for the package's cache store.local/null disk and a array cache driver, and avoid commands that hit the network. If you assert on rendered HTML, assert on the presence of @font-face and the preload tag rather than exact URLs, which vary by APP_URL.0.2.6 the package is pre-1.0, so minor bumps may still change config keys, method signatures or generated CSS structure. Pin to ^0.2.6 in composer.json and read CHANGELOG.md on every update — the release notes themselves are terse and will not warn you about config changes.config/font-manager.php, config caching (php artisan config:cache) means your changes are invisible until you re-cache. Symptom: "I changed the weight and nothing happened." Always config:clear in local dev.@font-face rules pointing at 404s. Guard against this with a deploy check, or set font-display: swap so a failure degrades to the fallback stack instead of invisible text.<link rel="preload" as="font" type="font/woff2" crossorigin> for the one or two weights used above the fold, and set explicit font-family fallbacks with size-adjust where the metrics differ noticeably.filesystems.disks.<your-disk>.url matches the disk the package writes to.unicode-range or variable-font font-variation-settings, do it in the published stub; that survives package upgrades, whereas monkey-patching the facade does not.font-family declaration (quotes and casing matter), (3) is the weight you requested actually in the set, (4) is a stale cached stylesheet being served.@font-face blocks) that should be removed now.How can I help you explore Laravel packages today?