The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

Avatar

laravolt/avatar image

Avatar stats

Downloads
2.6M
Stars
1,775
Open Issues
5
Forks
174

View on GitHub →

Turn name, email, and any other string into initial-based avatar or gravatar.

Laravolt Avatar

Laravolt Avatar is a dynamic avatar generation package for Laravel, ideal for creating unique avatars based on user names or initials. This versatile tool can be integrated into any PHP project, providing a range of customization options to generate avatars that fit seamlessly into your applications.

Key Features

  • Versatile Output Formats: Generate avatars as base64, save to files (PNG, JPG), and even output as SVGs.
  • Gravatar Support: Easily convert email addresses into Gravatar URLs with optional parameters.
  • Customization: Extensive configuration options including font, colors, size, shape, and themes.
  • Real-Time Config Overrides: Modify avatar properties on the fly without altering global settings.
  • Non-ASCII Character Support: Handles international characters by using appropriate fonts or converting them to ASCII.

Installation

Install via composer for Laravel >= 5.2:

composer require laravolt/avatar

For Laravel 5.1, use an older version:

composer require laravolt/avatar ~0.3

Laravel 5.5 and above benefits from package auto-discovery, eliminating the need for manual service provider registration.

Usage Examples

Output a base64 avatar:

<img src="{{ Avatar::create('Joko Widodo')->toBase64() }}" />

Save as a file:

Avatar::create('Susilo Bambang Yudhoyono')->save('sample.png');

Configuration

Publish the configuration file to customize default settings:

php artisan vendor:publish --provider="Laravolt\Avatar\ServiceProvider"

This will allow adjustments to aspects like image driver, dimensions, fonts, colors, and more within the config/laravolt/avatar.php file.

Integration with Other PHP Projects

For non-Laravel PHP projects:

require 'vendor/autoload.php';
use Laravolt\Avatar\Avatar;
 
$avatar = new Avatar($config);
$avatar->create('John Doe')->toBase64();

This package supports a broad range of applications, from simple blogs to complex web applications, ensuring users always have a personalized avatar.

laravolt photo

Membuat Sistem Informasi 2 minggu jadi

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Laravolt Avatar Related Articles

Plug and Play Avatars in Laravel with Laravolt image

Plug and Play Avatars in Laravel with Laravolt

Read article
Blastup logo

Blastup

Blastup provides social media enhancement services including buying Instagram likes, followers, and views, with features like instant delivery and a variety of packages to suit different needs.

Blastup
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
DreamzTech logo

DreamzTech

Hire 6-10+ Yrs. experienced skilled Laravel Developers from DreamzTech. We ensure NDA protected, 100% quality delivery. Contact Us & Discuss Your Need.

DreamzTech
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search
LoadForge logo

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge