定制 vinicius73/lavatar 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vinicius73/lavatar

Composer 安装命令:

composer require vinicius73/lavatar

包简介

Have easy access to various services of avatar, like the Gravatar. Package for Laravel.

README 文档

README

Have easy access to various services of avatar, like the Gravatar.

Latest Stable Version Total Downloads Latest Unstable Version License

Installation

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

Usage

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

Gravatar

   Lavatar::Gravatar('email@domain.com.br')->getUrl();
   Lavatar::Gravatar('email.another@domain.com.br')->image();

Twitter

   Lavatar::Twitter('twitterUserName')->getUrl();
   Lavatar::Twitter('twitterOther')->image();

Instagram

   Lavatar::Instagram('InstagramUserName')->getUrl();
   Lavatar::Instagram('InstagramOther')->image();

Facebook

   Lavatar::Facebook('FacebookUserName')->getUrl();
   Lavatar::Facebook('FacebookID')->image();

Minecraft

   Lavatar::Minecraft('MinecraftUserName')->getUrl();
   Lavatar::Minecraft('MinecraftUser')->image();
   
   Lavatar::Minecraft('MinecraftUser')->avatar();
   Lavatar::Minecraft('MinecraftUser')->skin();
   Lavatar::Minecraft('MinecraftUser')->helm();

Credits

统计信息

  • 总下载量: 364
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 26
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 25
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-08-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固