hassanalisalem/laravel-initial-image
Composer 安装命令:
composer require hassanalisalem/laravel-initial-image
包简介
Laravel package to create default profile image using name of user.
README 文档
README
Laravel package to create default profile image using first two letters of a name.
Installation
Install using composer:
composer require hassanalisalem/laravel-initial-image
Edit app/config/app.php and add the providers
'providers' => [
'hassanalisalem\Image\DefaultProfileImageServiceProvider'
]
Basic Usage
To create a profile image just do
$img = \DefaultProfileImage::create("Name Surname");
\Storage::put("profile.png", $img->encode());
This will create a profile image that has 512px width&height using the first letters of name and surname.
Advanced Usage
Create a white color text over black color background profile image that has 216px width&height.
$img = \DefaultProfileImage::create("Name Surname", 256, '#000', '#FFF');
\Storage::put("profile.png", $img->encode());
Using a custom font
$img = \DefaultProfileImage::create("@ Lamoni", 256, "#212121", "#FFF", '/var/www/public/fonts/RobotoDraftRegular.woff');
\Storage::put("profile.png", $img->encode());
统计信息
- 总下载量: 164
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-12-13