PHPackages                             elfsundae/laravel-gravatar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. elfsundae/laravel-gravatar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

elfsundae/laravel-gravatar
==========================

The easiest way to generate Gravatar avatar URL.

2.6.0(4y ago)388.9k7MITPHPPHP &gt;=5.6.4CI failing

Since Sep 15Pushed 4y ago2 watchersCompare

[ Source](https://github.com/ElfSundae/laravel-gravatar)[ Packagist](https://packagist.org/packages/elfsundae/laravel-gravatar)[ Docs](https://github.com/ElfSundae/laravel-gravatar)[ RSS](/packages/elfsundae-laravel-gravatar/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (12)Used By (0)

Laravel Gravatar Helper
=======================

[](#laravel-gravatar-helper)

[![](https://camo.githubusercontent.com/1b8ef7f4c653c287d72b70a83143ee3b2fe85302313bc67474da6f2dc0fdb09a/68747470733a2f2f7365637572652e67726176617461722e636f6d2f6176617461722f3030303030303030303030303030303030303030303030303030303030303030)](https://camo.githubusercontent.com/1b8ef7f4c653c287d72b70a83143ee3b2fe85302313bc67474da6f2dc0fdb09a/68747470733a2f2f7365637572652e67726176617461722e636f6d2f6176617461722f3030303030303030303030303030303030303030303030303030303030303030)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3216a0f656930d7dd2d62021871673e82b9a661cd1348f58a4fe8edc3b631f1a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c6673756e6461652f6c61726176656c2d67726176617461722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elfsundae/laravel-gravatar)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![tests](https://github.com/ElfSundae/laravel-gravatar/actions/workflows/tests.yml/badge.svg)](https://github.com/ElfSundae/laravel-gravatar/actions/workflows/tests.yml)[![SymfonyInsight Grade](https://camo.githubusercontent.com/16e01effb75c131f44aa557621d4ec4905f9e8a98b07c68f15b880629b489152/68747470733a2f2f696d672e736869656c64732e696f2f73796d666f6e792f692f67726164652f36653231336630662d653631382d346261352d623235322d3235373564313866323161393f7374796c653d666c61742d737175617265)](https://insight.symfony.com/projects/6e213f0f-e618-4ba5-b252-2575d18f21a9)[![Quality Score](https://camo.githubusercontent.com/49e04d566a11536ad99b2e4326c5281109fe2edf026e03f2adfc5c06a89ef588/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f456c6653756e6461652f6c61726176656c2d67726176617461722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ElfSundae/laravel-gravatar)[![Code Coverage](https://camo.githubusercontent.com/0b0c0305030df2ab485c523edb9e14b6570e2bf8dfd57a2dc8daed08457c4a21/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f456c6653756e6461652f6c61726176656c2d67726176617461722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ElfSundae/laravel-gravatar/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/3823eec990019c05eaa50f013b4d7148442f6ff8b3cdb132e2939890b6496073/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c6673756e6461652f6c61726176656c2d67726176617461722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elfsundae/laravel-gravatar)

The easiest way to generate [Gravatar](https://gravatar.com) avatar URL, with multiple connections support.

Installation
------------

[](#installation)

You can install this package using the [Composer](https://getcomposer.org) manager:

```
$ composer require elfsundae/laravel-gravatar
```

Then copy the [configuration file](config/gravatar.php) to your application:

```
$ cp vendor/elfsundae/laravel-gravatar/config/gravatar.php config/gravatar.php
```

For Lumen, you need to load the configuration file in your `bootstrap/app.php` :

```
$app->configure('gravatar');
```

API
---

[](#api)

[`gravatar()`](src/helpers.php) is a global helper function you can use anywhere.

```
/**
 * Generate Gravatar avatar URL for the given email address.
 *
 * @param  string      $email       Email or email hash
 * @param  string|int  $connection  Connection name or image size
 * @param  string|int  $size        Connection name or image size
 * @return string
 */
function gravatar($email, $connection = 'default', $size = null)
```

Usage
-----

[](#usage)

```
// For an email address, using the "default" connection configuration
gravatar('foo@example.com');

// For an email MD5 hash, using the "default" connection configuration
gravatar('b48def645758b95537d4424c84d1a9ff');

// Using the "large" connection
gravatar($email, 'large');

// Using the "default" connection, and overriding "size" parameter to 100
gravatar($email, 100);

// Using the "avatar" connection, and overriding "size" parameter to 100
gravatar($email, 'avatar', 100);
gravatar($email, 100, 'avatar');
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~162 days

Recently: every ~376 days

Total

11

Last Release

1595d ago

Major Versions

1.x-dev → 2.0.02017-11-14

PHP version history (3 changes)1.0.1PHP &gt;=5.3.0

2.0.0PHP &gt;=5.4.0

2.2.1PHP &gt;=5.6.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/526008?v=4)[Elf Sundae](/maintainers/ElfSundae)[@ElfSundae](https://github.com/ElfSundae)

---

Top Contributors

[![ElfSundae](https://avatars.githubusercontent.com/u/526008?v=4)](https://github.com/ElfSundae "ElfSundae (45 commits)")

---

Tags

gravatarlaravellaravel-gravatarlaravelhelpergravatar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/elfsundae-laravel-gravatar/health.svg)

```
[![Health](https://phpackages.com/badges/elfsundae-laravel-gravatar/health.svg)](https://phpackages.com/packages/elfsundae-laravel-gravatar)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[laravolt/avatar

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

2.0k5.8M39](/packages/laravolt-avatar)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k12.5k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
