a6digital / laravel-default-profile-image by toprakkaya

Laravel package to create default profile image using name of user.
171,924
40
9
Package Data
Maintainer Username: toprakkaya
Maintainer Contact: hasan@a6digital.com (Hasan Toprakkaya)
Package Create Date: 2015-03-23
Package Last Update: 2018-03-13
Language: PHP
License: MIT
Last Refreshed: 2024-04-30 15:08:01
Package Statistics
Total Downloads: 171,924
Monthly Downloads: 3,957
Daily Downloads: 135
Total Stars: 40
Total Watchers: 9
Total Forks: 6
Total Open Issues: 1

Laravel Default Profile Image

Latest Stable Version Total Downloads Latest Unstable Version License

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

Installation

Install using composer:

composer require a6digital/laravel-default-profile-image

Edit app/config/app.php and add the providers

'providers' => [
    'A6digital\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.

Profile Image

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

Profile Small Image

Using a custom font

$img = \DefaultProfileImage::create("@ Lamoni", 256, "#212121", "#FFF", '/var/www/public/fonts/RobotoDraftRegular.woff');
\Storage::put("profile.png", $img->encode());

Profile Small Image