Laravel package to create default profile image using name of user.
hassanalisalem/laravel-initial-image is a Laravel package for laravel package to create default profile image using name of user..
It currently has 0 GitHub stars and 164 downloads on Packagist (latest version v1.0.2).
Install it with composer require hassanalisalem/laravel-initial-image.
Discover more Laravel packages by hassanalisalem
or browse all Laravel packages to compare alternatives.
Last updated
Laravel package to create default profile image using first two letters of a name.
Install using composer:
composer require hassanalisalem/laravel-initial-image
Edit app/config/app.php and add the providers
'providers' => [
'hassanalisalem\Image\DefaultProfileImageServiceProvider'
]
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.
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());