faicchia/boring-avatars

Generate boring avatars in PHP

1.0.0 2022-12-04 21:06 UTC

This package is auto-updated.

Last update: 2024-04-05 00:02:37 UTC


README

Packagist Tests Style License

Generate boring avatars in PHP.

What is Boring Avatars?

Boring avatars is a tiny JavaScript React library that generates custom, SVG-based avatars from any username and color palette.

To know more go visit the official website

Installation

composer require faicchia/boring-avatars

Usage

use Faicchia\BoringAvatars\BoringAvatar;

$avatar = BoringAvatar::make()
    ->size(60)
    ->variant('bauhaus')
    ->name('James Smith')
    ->colors(['#2c5545', '#063971', '#2f353b'])
    ->url();
// https://source.boringavatars.com/bauhaus/60/James+Smith?colors=2c5545,063971,2f353b

Properties

Prop Type
size integer, 40px (default)
name string
variant oneOf: marble (default), beam, pixel,sunset, ring, bauhaus
colors array of colors