PHPackages                             leek/filament-dicebear - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. leek/filament-dicebear

ActiveLibrary[Image &amp; Media](/categories/media)

leek/filament-dicebear
======================

DiceBear avatar provider for Filament panels with 31 styles, caching, and per-model customization.

v1.1.0(2mo ago)5795↓28.9%MITPHPPHP ^8.2CI passing

Since Feb 23Pushed 2mo agoCompare

[ Source](https://github.com/leek/filament-dicebear)[ Packagist](https://packagist.org/packages/leek/filament-dicebear)[ RSS](/packages/leek-filament-dicebear/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Filament DiceBear
=================

[](#filament-dicebear)

[![Latest Version on Packagist](https://camo.githubusercontent.com/aabcc0d6fe0f67fae30216971ca5ff54e7229abd6a0fd78a6e4fdb2ed418ded9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c65656b2f66696c616d656e742d64696365626561722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leek/filament-dicebear)[![GitHub Tests Action Status](https://camo.githubusercontent.com/daf27f584bbafd67d830afe19884201b315be156fca7b74df8ac7055a470a995/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c65656b2f66696c616d656e742d64696365626561722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/leek/filament-dicebear/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/575928d4a7e2dd84ba4d8f580229de12301b105dade0c56f866de3339fd48377/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65656b2f66696c616d656e742d64696365626561722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leek/filament-dicebear)

A [DiceBear](https://www.dicebear.com/) avatar provider for [Filament](https://filamentphp.com/) panels. Supports all 31 avatar styles with caching, per-model customization, and self-hosted instances.

[![Filament DiceBear Avatar Examples](art/avatar-examples.png)](art/avatar-examples.png)

Installation
------------

[](#installation)

```
composer require leek/filament-dicebear
```

Optionally publish the config file:

```
php artisan vendor:publish --tag=filament-dicebear-config
```

Quick Start
-----------

[](#quick-start)

Register the plugin and avatar provider in your panel:

```
use Leek\FilamentDiceBear\DiceBearPlugin;
use Leek\FilamentDiceBear\DiceBearProvider;
use Leek\FilamentDiceBear\Enums\DiceBearStyle;

class AppPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->defaultAvatarProvider(DiceBearProvider::class)
            ->plugins([
                DiceBearPlugin::make()
                    ->style(DiceBearStyle::Thumbs),
            ]);
    }
}
```

That's it! All users without a custom avatar will now display a DiceBear avatar.

Plugin Configuration
--------------------

[](#plugin-configuration)

All configuration methods are optional and return the plugin instance for fluent chaining.

### Style

[](#style)

Choose from any of the [31 available styles](#available-styles):

```
DiceBearPlugin::make()
    ->style(DiceBearStyle::Adventurer)
```

You can also pass a string:

```
DiceBearPlugin::make()
    ->style('bottts-neutral')
```

### Universal Options

[](#universal-options)

These correspond to DiceBear's [universal query parameters](https://www.dicebear.com/how-to-use/http-api/):

```
DiceBearPlugin::make()
    ->size(128)              // Pixel dimensions
    ->radius(50)             // Corner radius (0-50)
    ->scale(80)              // Scale (0-200)
    ->rotate(45)             // Rotation (0-360)
    ->flip()                 // Mirror horizontally
    ->backgroundColor('ff0000')       // Hex color(s), comma-separated
    ->backgroundType('gradientLinear') // 'solid' or 'gradientLinear'
```

### Style-Specific Options

[](#style-specific-options)

Pass any style-specific parameters via `options()`:

```
DiceBearPlugin::make()
    ->style(DiceBearStyle::BotttsNeutral)
    ->options([
        'eyes' => 'bulging,eva,happy,hearts',
        'mouth' => 'diagram,smile01,smile02',
    ])
```

See the [DiceBear docs](https://www.dicebear.com/styles/) for available options per style.

### Seed Resolver

[](#seed-resolver)

By default, the provider uses the model's `id` as the seed. Customize it:

```
DiceBearPlugin::make()
    ->seedUsing(fn ($record) => $record->email)
```

### Caching

[](#caching)

SVGs are cached to disk by default to avoid repeated API calls:

```
DiceBearPlugin::make()
    ->cache(true)                    // Enable/disable (default: true)
    ->disk('public')                 // Storage disk (default: 'public')
    ->cachePath('avatars/dicebear')  // Cache directory (default: 'avatars/dicebear')
```

When caching is disabled, the SVG is returned as a base64 data URI.

To clear cached avatars:

```
Storage::disk('public')->deleteDirectory('avatars/dicebear');
```

### Self-Hosting

[](#self-hosting)

For production use or commercial projects, you may want to [self-host DiceBear](https://www.dicebear.com/guides/host-the-http-api-yourself/):

```
DiceBearPlugin::make()
    ->baseUrl('https://dicebear.example.com')
    ->apiVersion('9.x')
```

Per-Model Customization
-----------------------

[](#per-model-customization)

Use the `HasDiceBearAvatar` trait on any model implementing `HasAvatar` to customize avatars per model:

```
use Filament\Models\Contracts\HasAvatar;
use Leek\FilamentDiceBear\Concerns\HasDiceBearAvatar;
use Leek\FilamentDiceBear\Enums\DiceBearStyle;

class User extends Model implements HasAvatar
{
    use HasDiceBearAvatar;

    public function dicebearAvatarStyle(): DiceBearStyle
    {
        return DiceBearStyle::Thumbs;
    }
}
```

### With Uploaded Photo Fallback

[](#with-uploaded-photo-fallback)

Override `getCustomAvatarUrl()` to check for uploaded photos first:

```
class User extends Model implements HasAvatar
{
    use HasDiceBearAvatar;

    protected function getCustomAvatarUrl(): ?string
    {
        if ($this->avatar_url) {
            return Storage::url($this->avatar_url);
        }

        return null; // Falls back to DiceBear
    }

    public function dicebearAvatarStyle(): DiceBearStyle
    {
        return DiceBearStyle::Thumbs;
    }
}
```

### With Style-Specific Options

[](#with-style-specific-options)

```
class ClientProfile extends Model implements HasAvatar
{
    use HasDiceBearAvatar;

    public function dicebearAvatarStyle(): DiceBearStyle
    {
        return DiceBearStyle::BotttsNeutral;
    }

    public function dicebearAvatarOptions(): array
    {
        return [
            'eyes' => 'bulging,eva,frame1,frame2,happy,hearts',
            'mouth' => 'diagram,smile01,smile02',
        ];
    }
}
```

Available Styles
----------------

[](#available-styles)

### Minimalist

[](#minimalist)

StyleSlugLicenseGlass`glass`CC0 1.0Icons`icons`MITIdenticon`identicon`CC0 1.0Initials`initials`CC0 1.0Rings`rings`CC0 1.0Shapes`shapes`CC0 1.0Thumbs`thumbs`CC0 1.0### Characters

[](#characters)

StyleSlugCreatorLicenseAdventurer`adventurer`Lisa WischofskyCC BY 4.0Adventurer Neutral`adventurer-neutral`Lisa WischofskyCC BY 4.0Avataaars`avataaars`Pablo StanleyFreeAvataaars Neutral`avataaars-neutral`Pablo StanleyFreeBig Ears`big-ears`The Visual TeamCC BY 4.0Big Ears Neutral`big-ears-neutral`The Visual TeamCC BY 4.0Big Smile`big-smile`Ashley SeoCC BY 4.0Bottts`bottts`Pablo StanleyFreeBottts Neutral`bottts-neutral`Pablo StanleyFreeCroodles`croodles`vijay vermaCC BY 4.0Croodles Neutral`croodles-neutral`vijay vermaCC BY 4.0Dylan`dylan`Natalia SpivakCC BY 4.0Fun Emoji`fun-emoji`Davis UcheCC BY 4.0Lorelei`lorelei`Lisa WischofskyCC0 1.0Lorelei Neutral`lorelei-neutral`Lisa WischofskyCC0 1.0Micah`micah`Micah LanierCC BY 4.0Miniavs`miniavs`WebpixelsCC BY 4.0Notionists`notionists`ZoishCC0 1.0Notionists Neutral`notionists-neutral`ZoishCC0 1.0Open Peeps`open-peeps`Pablo StanleyCC0 1.0Personas`personas`DraftbitCC BY 4.0Pixel Art`pixel-art`DiceBearCC0 1.0Pixel Art Neutral`pixel-art-neutral`DiceBearCC0 1.0Toon Head`toon-head`Johan MelinCC BY 4.0Configuration File
------------------

[](#configuration-file)

```
// config/filament-dicebear.php
return [
    'style' => 'initials',
    'api_version' => '9.x',
    'base_url' => 'https://api.dicebear.com',
    'size' => null,
    'radius' => null,
    'scale' => null,
    'rotate' => null,
    'flip' => null,
    'background_color' => null,
    'background_type' => null,
    'cache' => [
        'enabled' => true,
        'disk' => 'public',
        'path' => 'avatars/dicebear',
    ],
];
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance85

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

76d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.1.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e11ad2f75cb1d558136f1982458d541d96fb84a217d6a82e8c18df2ff503964b?d=identicon)[leek](/maintainers/leek)

---

Top Contributors

[![leek](https://avatars.githubusercontent.com/u/60204?v=4)](https://github.com/leek "leek (5 commits)")

---

Tags

laravelsvgavatarfilamentfilamentphpleekDiceBear

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/leek-filament-dicebear/health.svg)

```
[![Health](https://phpackages.com/badges/leek-filament-dicebear/health.svg)](https://phpackages.com/packages/leek-filament-dicebear)
```

###  Alternatives

[awcodes/filament-curator

A media picker plugin for FilamentPHP.

434297.7k19](/packages/awcodes-filament-curator)[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

124139.3k2](/packages/dotswan-filament-map-picker)[joshembling/image-optimizer

Optimize your Filament images before they reach your database.

111145.4k12](/packages/joshembling-image-optimizer)[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

15828.6k](/packages/relaticle-custom-fields)[jibaymcs/filament-tour

Bring the power of DriverJs to your Filament panels and start a tour !

12247.8k](/packages/jibaymcs-filament-tour)[guava/filament-modal-relation-managers

Allows you to embed relation managers inside filament modals.

7565.0k4](/packages/guava-filament-modal-relation-managers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
