LaravelPackages.net
Acme Inc.
Toggle sidebar
hassanalisalem/laravel-initial-image

Laravel package to create default profile image using name of user.

164
0
v1.0.2
About hassanalisalem/laravel-initial-image

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 initial Image

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());
Comments