New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

saade/filament-facehash

Use Facehash as the default avatar provider in your Filament panels.
15,072 4
Install
composer require saade/filament-facehash
Latest Version:v1.1.0
PHP:^8.2
Laravel:11 · 12 · 13
License:MIT
Last Updated:Oct 19, 2026
Links: GitHub  ·  Packagist
Maintainer: saade

Filament Facehash

Plumb score

Facehash

Generate unique, deterministic avatar faces for your Filament panels. Drop-in replacement for default user avatars — same name always produces the same face. Pure SVG, no GD or Imagick required.

Try the playground

Installation

composer require saade/filament-facehash

Usage

Add the provider to your panel configuration. The plugin is optional — register it when you want to customize the avatars for that panel:

use Saade\FilamentFacehash\FacehashPlugin;
use Saade\FilamentFacehash\FacehashProvider;

public function panel(Panel $panel): Panel
{
    return $panel
        ->defaultAvatarProvider(FacehashProvider::class)
        ->plugins([
            FacehashPlugin::make(),
        ]);
}

Configuration

Customize the avatars using the plugin's fluent API:

use Saade\Facehash\Enums\Format;
use Saade\Facehash\Enums\Variant;
use Saade\FilamentFacehash\FacehashPlugin;

FacehashPlugin::make()
    ->size(40)                       // Avatar size in pixels (default: 40)
    ->variant(Variant::Gradient)     // Variant::Gradient or Variant::Solid (default: Gradient)
    ->format(Format::Circle)         // Format::Circle, Format::Square or Format::Squircle (default: Circle)
    ->initial(true)                  // Show first letter of name (default: true)
    ->blink(false)                   // Animate the eyes (default: false)
    ->colors([                       // Custom color palette
        '#ec4899',
        '#f59e0b',
        '#3b82f6',
        '#f97316',
        '#10b981',
    ])

Any option you leave unset falls back to the defaults in config/facehash.php, so the defaults shown above are the ones Facehash ships with. A record with a blank name gets a ? avatar. For more configuration options (routes, default overrides, etc.), visit the Facehash package documentation.

Model Trait

For using facehash avatars outside of Filament panels (e.g. in Blade views, notifications), add the trait to your User model:

use Saade\FilamentFacehash\Concerns\HasFacehashAvatar;

class User extends Authenticatable
{
    use HasFacehashAvatar;
}

This gives you:

$user->facehash_avatar_url  // data:image/svg+xml;base64,...

The avatar uses the options of the plugin on the current panel — or on the default panel when there is no current one — so it matches what Filament shows.

Override which attribute is used as the avatar name:

use Illuminate\Database\Eloquent\Casts\Attribute;

public function facehashAvatarName(): Attribute
{
    return new Attribute(
        get: fn () => $this->email  // use email instead of name
    );
}

Testing

composer test

Credits

License

MIT

Related Packages

saade/facehash

Deterministic avatar faces from any string. Lightweight, pure SVG output. Larave...

15,758 7
leek/filament-dicebear

DiceBear v10 avatar provider for Filament panels: 61 styles, animated avatars, n...

4,154 6
finity-labs/fin-avatar

Privacy-focused SVG avatar generator for Filament.

10,563 3
gabriel2m/filament-starter-kit

Skeleton application for Filament.

8 0
nhanchaukp/filament-copyactions

A easy-to-use copy actions for Filament Admin.

884 1

Version History

Version Released PHP License
v1.1.0 ^8.2 MIT
v1.0.1 ^8.2 MIT
v1.0.0 ^8.2 MIT