Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Lavatar Laravel Package

vinicius73/lavatar

Lavatar is a Laravel package for generating avatar images from names or emails. It creates initials-based avatars with customizable colors, fonts, and sizes, caches generated images, and integrates easily with Eloquent models for simple user profile avatars.

View on GitHub
Deep Wiki
Context7

Have easy access to various services of avatar, like the Gravatar. Package for Laravel.

Frequently asked questions about Lavatar
What is Lavatar and what does it do?
Lavatar is a lightweight Laravel package that turns a name or email address into a ready-to-use avatar image URL, so you can show consistent profile pictures without storing files or handling uploads. It generates initials-based avatars with configurable colors, fonts, and sizes, and ships as a standard Laravel package with a service provider, a publishable config file, an Eloquent trait, and a Blade directive or helper. It is aimed at comments, dashboards, and admin panels where you need a placeholder identity image fast.
How do I install Lavatar in a Laravel application?
Install it with Composer using composer require vinicius73/lavatar, then publish the package config so you can set your avatar source, size, and colors. Because the package predates Laravel's auto-discovery era, you may need to register the service provider and any facade manually in config/app.php. After that, render an avatar from a Blade view using the provided directive or helper.
Does Lavatar support Laravel 10, 11, or 12?
Lavatar's last tagged release is from July 2015, which places it in the Laravel 5.x and PHP 5.5 era. There is no test matrix or confirmed support for Laravel 9, 10, 11, or 12, and Composer will likely refuse to resolve its illuminate/support constraint against a modern root project. If you attempt an upgrade, expect to patch removed framework helpers and older Blade syntax. Treat Laravel 5.x through 6.x as the realistic target.
How do I display an avatar in a Blade view with Lavatar?
Lavatar exposes a Blade directive and a helper so you can output an avatar in one line rather than building image markup yourself. You define the avatar source in the package config, then call the directive or helper wherever you need the image, passing the user or the name and email values. Keeping the view contract decoupled from the package makes it easier to swap the implementation later.
Can Lavatar build avatars from a user's name, initials, or email address?
Yes. The avatar source is configurable, so you can generate from a full name, pre-computed initials, or an email address, and the package derives initials from whatever you supply. How gracefully it handles single-word names, honorifics, diacritics, and non-Western naming conventions is worth testing with your real user data, since wrong initials are a visible, user-facing defect.
How do I customize avatar size and colors in Lavatar?
Size, colors, font settings, and the image provider are all controlled through the publishable config file, so you can match your application's palette without touching package code. Publish the config with the vendor:publish command, adjust the values, and the rendered avatars pick them up. Check whether the chosen provider renders a raster image or HTML markup, since that affects email, PDF, and API consumers.
Does Lavatar cache generated avatars?
Lavatar includes built-in caching intended to avoid regenerating the same avatar on every request. Caching behavior depends on your configured cache driver and any package-level cache settings, so verify where avatars are stored, what the cache lifetime is, and whether anything is written to disk that needs cleanup. Confirm the response content type and cache headers if you plan to serve avatars through a CDN.
Does Lavatar integrate with Eloquent models?
Yes. The package provides a reusable trait that adds an avatar accessor, so you can read $user->avatar directly in your views and Blade templates. Before adopting it, confirm the accessor name does not collide with an existing avatar attribute, cast, or appended accessor on your model. Many teams prefer to keep avatar policy in a small domain service and leave the model untouched.
Is Lavatar a good alternative to Gravatar or a SaaS avatar API?
The main architectural advantage is that Lavatar needs no external service, so there is no third-party latency on render, no API keys, no rate limits, and no user PII leaving your perimeter, which removes a data-processing agreement from the picture. The trade-off is that you own the rendering, fonts, and caching yourself. If your estate includes non-Laravel PHP services, you would need to reimplement the same initials logic there anyway.
Is Lavatar actively maintained, and is it safe for production?
Lavatar has a single maintainer, roughly two dozen GitHub stars, and no release since 2015, so there is no security-response channel and no PHP 8 test matrix. The codebase is small and MIT-licensed, which makes forking genuinely viable, but that is a long-term ownership commitment rather than a quick fix. For new projects, weigh it against writing a few hundred lines of in-house initials-avatar code.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons