voltra/filament-svg-avatar
Swap Filament’s default avatar URL provider for inline SVG avatars. Generate initials-based avatars without external HTTP requests, with configurable size, background/text colors, and font family. Includes publishable config and optional view overrides.
SvgAvatarServiceContract), enabling custom logic.@font-face in CSS)?John Doe → "JD").name field).->plugins([
\Voltra\FilamentSvgAvatar\FilamentSvgAvatarPlugin::make()
->backgroundColor('#3b5998')
->textColor('#e9ebee'),
])
->defaultAvatarProvider(\Voltra\FilamentSvgAvatar\Filament\AvatarProviders\RawSvgAvatarProvider::class)
php artisan vendor:publish --tag=filament-svg-avatar-core-overrides
if (!$user->avatar_url) use SVG).php artisan view:clear) if SVG rendering performance is critical.composer require voltra/filament-svg-avatar spatie/color
php artisan vendor:publish --tag="filament-svg-avatar-config"
svgSize, backgroundColor).SvgAvatarServiceContract.vendor:publish) reduces drift but requires version control for customizations.SvgAvatarServiceContract may need updates if Filament’s avatar logic changes.view:clear.filament:debug) to inspect avatar provider chain.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Font not available on user’s OS | Avatars show as boxes or text | Use system fonts (e.g., Arial) or embed fonts. |
| Plugin/provider misconfiguration | Avatars fail to render | Validate registration order in PanelProvider. |
| Filament upgrade breaks compatibility | Avatars stop working | Test in staging; follow migration guides. |
| Custom service contract errors | Dynamic avatars fail | Add error boundaries (e.g., fallback to URL). |
| Blade cache corruption | Stale SVG avatars | Implement cache invalidation or use view:clear. |
How can I help you explore Laravel packages today?