vinicius73/laravel-instantavatar

Create a very pretty random avatars with ease. Package for Laravel
480 28
Install
composer require vinicius73/laravel-instantavatar
Latest Version:v1.1.0
PHP:>=5.4.0
Last Updated:Oct 4, 2015
Links: GitHub  ·  Packagist
Maintainer: vinicius73

Laravel - Instant Avatar

Create a very pretty random avatars with ease.

installation

Add the new required package in your composer.json

"vinicius73/laravel-instantavatar": "~1.1"

Run composer update or php composer.phar update.

After composer command, add new service provider in app/config/app.php :

Vinicius73\IAvatar\IAvatarServiceProvider::class,

Now, add new aliases in app/config/app.php.

'IAvatar' => Vinicius73\IAvatar\Facade\IAvatarFacade::class,

Finally publish the configuration file of the package php artisan vendor:publish

Usage

/**
 * Creates the image. Only the first letter will be passed to the image.
 * Ex.:
 * 'My String' -> output My
 * You can change this in the settings
 */
$avatar = IAvatar::random('My String');

/**
 * Save imagem in path
 * You can use `public::` Omit the full address /public
 */
$avatar->save('public::path/to/file.png');

/**
 * Output image in browser
 */
$avatar->display();
IAvatar::random('Vinicius')->save('public::avatars/vinicius.png')->display();

Configuration

return array(
    'width'    => 150,
    'heigth'   => 150,
    'fontsize' => 80, // in px
    'chars'    => 2, // Character limit for every image
    'font' => array( // You can register or remove more sources with ease.
        'InstantAvatar::Comfortaa-Regular.ttf',
        'InstantAvatar::Roboto-Regular.ttf',
        'InstantAvatar::Ubuntu-Regular.ttf',
        'InstantAvatar::DroidSans.ttf'
    ),
    'overlay'  => 'InstantAvatar::glass.png', // A watermark that overlays the image
    'flat'     => false // Enables the flat mode
);

Demo

Default

Instant Avatar

Flat

Color based in avatarly

Instant Avatar Flat

Related Packages

erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

622,487,850 9,703
laravel/framework

The Laravel Framework.

568,663,231 34,884
laravel/tinker

Powerful REPL for the Laravel framework.

478,440,860 7,440