luckyboy1001/avatarate
Composer 安装命令:
composer require luckyboy1001/avatarate
包简介
Package built for create avatars from text(username, ...)
README 文档
README
Demo Of Name Like This Mana Lovez :
With this package you can easily generate profile photos in different formats (for now just png)
installation
composer require luckyboy1001/avatarate
config the package
just create the directory and give the path on config file of package (avatarate)
Notice: PHP 7.4 is needed
publish config
php artisan vendor:publish --provider=Avatarate\AvatarateServiceProvider
avatarate.php will be published to your config directory
- more options will be added
notice
after config the avatarate config file you must give it a save_directory that should be
- created before
- writeable
example
$name = "Mohammad Mohammadi"; $background_color = 'random'; $text_color = [220, 120, 12, 1]; // rgb or rgba or random $shape = "circle"; // rectangle, circle $size = 240; $image = new \Avatarate\Services\AvatarBuilder( $name, $background_color, $text_color, $shape, $size ); $result = $image->generate();
result :
{
status: "success",
file_name: "avatarate-1634383742",
path: "path-to-laravel-project/public/avatarate/avatarate-1634383742.png"
}
and then image is saved in the directory you have given to config file of the package
Notice
this package developed based on an open source laravel project I decided to improve it and add new features
- to do
- unit tests
- new features
please give me a star if you like it
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2021-10-16