adetoola/avatar

使用首字母的类似Gmail的默认头像

0.1.0 2017-03-28 16:10 UTC

This package is not auto-updated.

Last update: 2024-09-20 19:44:15 UTC


README

使用首字母的类似Gmail的默认头像

内容

安装

通过终端的Composer使用

$ composer require adetoola/sms

通过composer.json中的Composer使用

首先,通过编辑您的项目中的composer.json文件来安装avatar。只需添加

'require": {
    "adetoola/avatar": "0.1.*"
}

然后运行composer installcomposer update

如果您正在使用laravel,打开config/app.php并在providers数组中添加。

'providers' => [
    // ...
    Adetoola\Avatar\AvatarServiceProvider::class,
],

然后,找到aliases并添加Facade到数组中。

'aliases' => [
    // ...
    'Avatar' => Adetoola\Avatar\Facades\AvatarFacade::class,
],

配置

安装后,通过运行将包配置文件发布到您的应用程序中

php artisan vendor:publish

##使用方法 Avatar旨在易于使用。

$avatar = new Adettola\Avatar\Avatar();
$image = $avatar->size(150)
                ->background('#fff')
                ->rounded()
                ->color('#eee')
                ->font('roboto.ttf')
                ->fontSize(0.667)
                ->generate()
                ->stream();

## Change log

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

## Security

If you discover any security related issues, please email adetola.onasanya@gmail.com instead of using the issue tracker.

## Credits

- [Adetola Onasanya](https://github.com/Adetoola)

## License

SMS is an open-sourced package licensed under the [MIT license](http://open-source.org.cn/licenses/MIT).