darbaoui/laravel-ui-avatars

generate an avatar image based on the name, size and background color and more

1.0.8 2022-10-25 11:43 UTC

This package is auto-updated.

Last update: 2024-10-25 15:59:56 UTC


README

StyleCI Shield build:passed Total Downloads Latest Stable Version License

Installation

This package requires Laravel 5.4 or higher.

  1. You can install the package via composer:
composer require darbaoui/laravel-ui-avatars

Usage

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

Available methods