| Install | |
|---|---|
composer require awcodes/filament-gravatar |
|
| Latest Version: | v4.0.0 |
| PHP: | ^8.2 |
Replace Filament's default avatar url provider with one for Gravatar.
| Package Version | Filament Version |
|---|---|
| 1.x | 2.x |
| 2.x | 3.x |
| 3.x | 4.x |
| 4.x | 5.x |
First, install the plugin with composer.
composer require awcodes/filament-gravatar
Next, add the GravatarProvider to your panel.
use Awcodes\Gravatar\GravatarProvider;
use Awcodes\Gravatar\GravatarPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->defaultAvatarProvider(GravatarProvider::class)
->plugins([
GravatarPlugin::make(),
])
}
You can modify the global defaults by using the following methods on the GravatarPlugin.
use Awcodes\Gravatar\GravatarPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
GravatarPlugin::make()
->default('robohash')
->size(200)
->rating('pg'),
])
}
You can also use the Awcodes\Gravatar\Gravatar class by itself should you need to outside a panel.
Awcodes\Gravatar\Gravatar::get(
string $email = null,
int $size = 80,
string $default = 'mp',
string $rating = 'g',
bool $asImage = false,
array $attributes = []
);
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.