Facehash
CommunityGenerate unique, deterministic avatar faces for your Filament panels.
filament/
namespace. Review the source and install at your own risk. Found
malware or an unresolved security issue the author won't
address?
Report it
.
Author:
Saade
Documentation

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.
#Installation
composer require saade/filament-facehash
#Usage
Add the provider and plugin to your panel configuration:
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\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)
->initial(true) // Show first letter of name (default: true)
->colors([ // Custom color palette
'#ec4899',
'#f59e0b',
'#3b82f6',
'#f97316',
'#10b981',
])
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,...
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
);
}
#Credits
- Facehash for Laravel — the underlying PHP/Laravel package
- Facehash by Cossistant — the original JavaScript library
#License
MIT
The author
CTO & Backend Engineer at a Brazilian startup. Creating top-tier technology for public sector applications, making information and services universally accessible.
From the same author
Autograph
A package to collect signatures.
Author:
Saade
Laravel Log
Read Laravel logs from the Filament admin panel.
Author:
Saade
FullCalendar
The most popular JavaScript calendar as a Filament widget.
Author:
Saade
Adjacency List
A package to manage adjacency lists.
Author:
Saade
Featured Plugins
A selection of plugins curated by the Filament team
Custom Dashboards
Let your users build and share their own dashboards with a drag-and-drop interface. Define your data sources in PHP and let them do the rest.
Filament
Spotlight Pro
Browse your Filament Panel with ease. Filament Spotlight Pro adds a Spotlight/Raycast like Command Palette to your Filament Panel.
Dennis Koch
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese