| Package Data | |
|---|---|
| Maintainer Username: | vinicius73 |
| Maintainer Contact: | luiz.vinicius73@gmail.com (Vinicius Reis) |
| Package Create Date: | 2014-08-15 |
| Package Last Update: | 2015-11-20 |
| Home Page: | |
| Language: | PHP |
| License: | Unknown |
| Last Refreshed: | 2025-10-31 03:03:26 |
| Package Statistics | |
|---|---|
| Total Downloads: | 364 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 25 |
| Total Watchers: | 1 |
| Total Forks: | 0 |
| Total Open Issues: | 1 |
Have easy access to various services of avatar, like the Gravatar.
Run composer require vinicius73/lavatar in your console, or add the new required package in your composer.json
"vinicius73/lavatar": "0.6.*"
Run composer update or php composer.phar update.
After composer command, add new service provider in app/config/app.php :
Vinicius73\Lavatar\LavatarServiceProvider::class,
Now, add new aliases in app/config/app.php.
'Lavatar' => Vinicius73\Lavatar\Facade\LavatarFacade::class,
Finally publish the configuration file of the package php artisan vendor:publish vinicius73/lavatar
The mechanics of use of the package is quite simple, with it you have access avatars APIs: Gravatar, Minecraft and Avatars.io (Twitter, Facebook and Intagram)
Basic command. With it you create a type ProvidersInterface default object, which can be customized in the configuration file.
$avatar = Lavatar::make($identificator); // Creates standard object (Gravatar|Another)
$avatar->getUrl(); // Returns the URL of the avatar.
$avatar->image(); // Returns the image html tag.
$avatar->getUrl($options); // Override the default settings of the object
// @var string $alt alt img tag
// @var array $options Override the default settings of the object
// @var array $atts extra img html tags
$avatar->image($alt,$options,$atts);
Access more than one provider avatar is easy, just call him
Lavatar::Gravatar('email@domain.com.br')->getUrl();
Lavatar::Gravatar('email.another@domain.com.br')->image();
Lavatar::Twitter('twitterUserName')->getUrl();
Lavatar::Twitter('twitterOther')->image();
Lavatar::Instagram('InstagramUserName')->getUrl();
Lavatar::Instagram('InstagramOther')->image();
Lavatar::Facebook('FacebookUserName')->getUrl();
Lavatar::Facebook('FacebookID')->image();
Lavatar::Minecraft('MinecraftUserName')->getUrl();
Lavatar::Minecraft('MinecraftUser')->image();
Lavatar::Minecraft('MinecraftUser')->avatar();
Lavatar::Minecraft('MinecraftUser')->skin();
Lavatar::Minecraft('MinecraftUser')->helm();