PHP code example of lshorz / lavatar

1. Go to this page and download the library: Download lshorz/lavatar library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lshorz / lavatar example snippets


'providers' => [
    ...
    
    Lshorz\Lavatar\LavatarServiceProvider::class,
],

'aliases' => [
    ...
    
    'Lavatar' => Lshorz\Lavatar\Facades\Lavatar::class,

],

Lavatar::displayImage('user');

lavatar_img('Hello');

<img src="{{ Lavatar::getAvatarBase64('user', 120, null, 'FFFFFF') }}" />

Route::get('/test', function(){
   return lavatar_base64('hello');
});