- 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.