PHP code example of darbaoui / laravel-ui-avatars

1. Go to this page and download the library: Download darbaoui/laravel-ui-avatars 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/ */

    

darbaoui / laravel-ui-avatars example snippets



use Darbaoui\Avatar\Facades\Avatar;

// simple avatar
Avatar::name('imad darbaoui')
        ->background('ffd1bf')
        ->color('ff4500')->get();
// avatar = https://ui-avatars.com/api/?name=imad+darbaoui&background=ffd1bf&color=ff4500


// you can chain any other method if you want to add other parameters to your avatar
Avatar::name('imad darbaoui')
        ->size(124)
        ->rounded()
        ->uppercase(false)
        ->svg()
        ->background('ffd1bf')
        ->color('ff4500')->get();
// avatar = https://ui-avatars.com/api/?size=124&rounded=1&uppercase=0&format=svg&name=imad+darbaoui&background=ffd1bf&color=ff4500