Weave 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
Filament Facehash

Filament Facehash Laravel Package

saade/filament-facehash

Generate unique, deterministic SVG avatar faces for Filament panels. The same name always produces the same face. A drop-in replacement for default user avatars, no GD or Imagick needed, with customizable size, colors and variants plus a trait for Blade views and notifications.

View on GitHub
Deep Wiki
Context7

Filament Facehash generates unique, deterministic SVG avatar faces for your Filament panels, acting as a drop-in replacement for default user avatars. The same name always produces the same face, and it's pure SVG — no GD or Imagick extension required.

Register the plugin and set FacehashProvider as your panel's default avatar provider. Then customize avatars fluently with size, variant (Gradient or Solid), initials, and a custom color palette. A HasFacehashAvatar trait exposes facehash_avatar_url for use in Blade views and notifications.

  • Deterministic faces: identical names yield identical avatars
  • Pure SVG output — no image extensions needed
  • Fluent config for size, variant, initials, colors
  • Model trait for avatars outside Filament panels
  • Override the name attribute (e.g. use email)
Frequently asked questions about Filament Facehash
How do I install saade/filament-facehash in a Laravel Filament panel?
Install it with composer require saade/filament-facehash. In your panel provider, add ->defaultAvatarProvider(FacehashProvider::class) and register FacehashPlugin::make() in the plugins array. That swap makes facehash avatars the default across the panel, with no image extensions or storage setup needed.
Does filament-facehash require GD or Imagick?
No. Facehash generates pure SVG output in PHP and returns it as a base64 data URI, so neither GD nor Imagick is required. That makes it easy to deploy on minimal PHP environments that do not have image extensions enabled.
How do I customize facehash avatar size, colors, and variant in Filament?
Chain options onto FacehashPlugin::make(): ->size(40) sets pixel size, ->variant(Variant::Gradient) or Variant::Solid picks the style, ->initial(true) toggles the first-letter overlay, and ->colors([...]) supplies a custom palette. Defaults are size 40, gradient variant, and initials enabled. More advanced overrides are documented in the underlying saade/facehash package.
Can I use facehash avatars in Blade views and notifications outside Filament?
Yes. Add the HasFacehashAvatar trait to your User model and use $user->facehash_avatar_url wherever you need an avatar, such as Blade templates or notification views. The value is a data:image/svg+xml;base64 URI, so it can go straight into an img src. Be cautious with transactional email, because SVG data-URI support in mail clients is uneven.
How do I change the attribute used for facehash avatars from name to email?
Override the facehashAvatarName() method on your model and return an Eloquent Attribute, for example new Attribute(get: fn () => $this->email). Facehash uses that value as the deterministic seed. Changing the attribute changes every user's avatar, so decide the recognition-versus-privacy trade-off before rollout.
Why do two users with the same name get the same facehash avatar?
Facehash is deterministic by design: identical names always produce identical faces. That is convenient for consistency, but it is a real usability regression in user-management and support screens when duplicate display names exist. If collisions matter, derive the avatar from a unique attribute such as email or another identifier instead of name.
Which Filament and Laravel versions does saade/filament-facehash support?
The defaultAvatarProvider integration point is a Filament v3-era extension seam, so verify compatibility with your deployed Filament version before adopting. Check the package composer.json for its Filament, Laravel, and PHP constraints rather than assuming current-version support. Pin the version you validate and re-check constraints when upgrading Filament.
Does filament-facehash work with a Content Security Policy that blocks data: images?
Only if your CSP permits img-src data:. The trait and panel avatars render as data:image/svg+xml;base64 URIs, so a restrictive policy will block them at render time in production even if everything worked locally. Confirm your CSP before rollout, because this is the most likely integration surprise.
Is saade/filament-facehash production-ready and actively maintained?
It is a small, single-maintainer package at v1.0.0 with no dependents and no evidence of tests or CI in the supplied signals, so treat it as a focused utility rather than a battle-tested platform component. The integration surface is narrow and removal is essentially a one-line revert, which limits risk. For production, pin the version, review the source, add a feature test asserting the avatar URL is a valid data URI, and verify release tag provenance.
What are the alternatives to filament-facehash for Filament avatars?
Alternatives include Filament's default avatar handling, Gravatar-style remote avatars, uploaded user photos stored on disk or S3, and UI avatar services. The underlying saade/facehash package can also be used directly if you want deterministic SVG faces without the Filament plugin. If your roadmap requires user-uploaded or user-chosen photos, facehash is intentionally not a fit.
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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator