by Adam Weston
A UI Avatar provider to replace Filament's default avatar url provider with one for Gravatar.
Replace Filament's default avatar url provider with one for Gravatar.
First, install the plugin with composer.
composer require awcodes/filament-gravatar
Next, update your Filament config file to use the new avatar provider.
'default_avatar_provider' => \FilamentGravatar\UiAvatarsProvider::class,
You can modify the global defaults, should you need to by publishing the config file.
php artisan vendor:publish --tag="filament-gravatar-config"
You can also use the FilamentGravatar\Gravatar
class by itself should you need to outside of Filament.
FilamentGravatar\Gravatar::get( string $email = null, int $s = 80, string $d = 'mp', string $r = 'g', bool $img = false, $atts = []);