PHPackages                             cmdinglasan/filament-boring-avatars - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cmdinglasan/filament-boring-avatars

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

cmdinglasan/filament-boring-avatars
===================================

Change the default avatar URL provider for Filament to one from Boring Avatars.

v1.2(2y ago)72.7k↓100%2[2 PRs](https://github.com/cmdinglasan/filament-boring-avatars/pulls)MITPHPPHP ^8.0.2

Since Sep 26Pushed 2y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (11)Versions (11)Used By (0)

Filament Boring Avatars
=======================

[](#filament-boring-avatars)

[![Filament Boring Avatars Banner](https://camo.githubusercontent.com/5f5f5a737ccba69361da447746f36a74719f7fae9d76ede1568f830e39f72a6b/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f46696c616d656e74253230426f72696e67253230417661746172732e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d636d64696e676c6173616e25324666696c616d656e742d626f72696e672d61766174617273267061747465726e3d617263686974656374267374796c653d7374796c655f32266465736372697074696f6e3d5573652b426f72696e672b417661746172732b61732b46696c616d656e742b557365722b41766174617273266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/5f5f5a737ccba69361da447746f36a74719f7fae9d76ede1568f830e39f72a6b/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f46696c616d656e74253230426f72696e67253230417661746172732e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d636d64696e676c6173616e25324666696c616d656e742d626f72696e672d61766174617273267061747465726e3d617263686974656374267374796c653d7374796c655f32266465736372697074696f6e3d5573652b426f72696e672b417661746172732b61732b46696c616d656e742b557365722b41766174617273266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bf0c4c2af4811dd86fbfbe91e7d995c69f9131950e7079764da07bbebc5d2983/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636d64696e676c6173616e2f66696c616d656e742d626f72696e672d617661746172732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cmdinglasan/filament-boring-avatars)[![GitHub Tests Action Status](https://camo.githubusercontent.com/81d3063c7fc552d7f88def869ee3753d7984c47acfeb72ed3c24db446b92f15b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f636d64696e676c6173616e2f66696c616d656e742d626f72696e672d617661746172732f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/cmdinglasan/filament-boring-avatars/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/2a782d73e724cf12a22b52874b68b8178626908bfea2fef9de0521abcb62b5fe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f636d64696e676c6173616e2f66696c616d656e742d626f72696e672d617661746172732f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d636f64652532307374796c65)](https://github.com/cmdinglasan/filament-boring-avatars/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/9f8090c08e8f53d9cfcd67fdef471f889e144f260639e68cdb1ecea86eac3688/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636d64696e676c6173616e2f66696c616d656e742d626f72696e672d617661746172732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cmdinglasan/filament-boring-avatars)

Change the default avatar URL provider for Filament to one from Boring Avatars.

Notice
------

[](#notice)

This package is made for Filament v2. **This package doesn't support Filament v3.**

For Filament v3, see the Boring Avatars implementation and setup of a different avatar provider in the [Filament v3 Docs](https://filamentphp.com/docs/3.x/panels/users#using-a-different-avatar-provider).

Why choose this plugin?
-----------------------

[](#why-choose-this-plugin)

> Boring avatars is a tiny JavaScript React library that generates custom, SVG-based avatars from any username and color palette.

This plugin uses the [Boring Avatar](https://github.com/boringdesigners/boring-avatars) API to get generated user avatars. Only the initials of the Filament User's name are submitted to the API.

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

[](#installation)

You can install the package via composer:

```
composer require cmdinglasan/filament-boring-avatars
```

You can publish the config file with:

```
php artisan vendor:publish --tag="filament-boring-avatars-config"
```

This is the contents of the published config file:

```
return [
    // default source url for Boring Avatars API
    'url' => 'https://source.boringavatars.com',

    // variants = marble (default), beam, pixel, sunset, ring, bauhaus
    'variant' => 'marble',

    // size in px
    'size' => '40',

    // array of colors to use
    'colors' => ['#264653','#2a9d8f','#e9c46a','#f4a261','#e76f51'],
];
```

How to use
----------

[](#how-to-use)

### 1. In Filament

[](#1-in-filament)

Inside the Filament `config.php` file, change the `avatar_url_provider` to `Cmdinglasan\FilamentBoringAvatars\AvatarProviders\UiAvatarsProvider::class`.

```
/*
|--------------------------------------------------------------------------
| Default Avatar Provider
|--------------------------------------------------------------------------
|
| This is the service that will be used to retrieve default avatars if one
| has not been uploaded.
|
*/

'default_avatar_provider' => Cmdinglasan\FilamentBoringAvatars\AvatarProviders\UiAvatarsProvider::class,
```

### 2. Inside your own Laravel app

[](#2-inside-your-own-laravel-app)

To use this inside your Laravel app, just add the `HasAvatarUrl` trait to your models.

```
