PHPackages                             digitonic/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. digitonic/laravel-gravatar

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

digitonic/laravel-gravatar
==========================

Laravel 5 Gravatar helper

2.0.0(6y ago)080MITPHPPHP &gt;=5.4.0

Since Nov 3Pushed 6y agoCompare

[ Source](https://github.com/digitonic/laravel-gravatar)[ Packagist](https://packagist.org/packages/digitonic/laravel-gravatar)[ Docs](https://github.com/thomaswelton/laravel-gravatar)[ RSS](/packages/digitonic-laravel-gravatar/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (4)Versions (10)Used By (0)

[![Build Status](https://camo.githubusercontent.com/e8435717e3e02a890c4fa8124bf0c5fe4e065a30c9ee40727fe8eb9073e486b2/68747470733a2f2f7472617669732d63692e6f72672f74686f6d617377656c746f6e2f6c61726176656c2d67726176617461722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/thomaswelton/laravel-gravatar)[![Latest Stable Version](https://camo.githubusercontent.com/6a417685d9dac55b3abdd4ce9bc0233514a8bdf26813e2f82d3e3db5693abf43/68747470733a2f2f706f7365722e707567782e6f72672f74686f6d617377656c746f6e2f6c61726176656c2d67726176617461722f762f737461626c652e706e67)](https://packagist.org/packages/thomaswelton/laravel-gravatar)[![Total Downloads](https://camo.githubusercontent.com/10efbb91decdbe2f78a9f8eeb60abc80ce935d31fde4aa46bfe1aa96a836351b/68747470733a2f2f706f7365722e707567782e6f72672f74686f6d617377656c746f6e2f6c61726176656c2d67726176617461722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/thomaswelton/laravel-gravatar)[![Bitdeli Badge](https://camo.githubusercontent.com/3e061d884ecf2b790a226fd3c498693f1cb4621e4de100df324a8465154c80ee/68747470733a2f2f64327765637a68766c38323376302e636c6f756466726f6e742e6e65742f74686f6d617377656c746f6e2f6c61726176656c2d67726176617461722f7472656e642e706e67)](https://bitdeli.com/free "Bitdeli Badge")

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

[](#installation)

Update your `composer.json` file to include this package as a dependency

```
"thomaswelton/laravel-gravatar": "~1.0"
```

> This package supports the [package discovery](https://laravel.com/docs/5.5/packages#package-discovery) functionality provided in Laravel 5.5, so registering the classes as described below is no longer necessary if you use Laravel 5.5.

Register the Gravatar service provider by adding it to the providers array in the `config/app.php` file.

```
Thomaswelton\LaravelGravatar\LaravelGravatarServiceProvider::class
```

Alias the Gravatar facade by adding it to the aliases array in the `config/app.php` file.

```
'aliases' => [
     'Gravatar' => Thomaswelton\LaravelGravatar\Facades\Gravatar::class
]
```

Configuration - Optional
------------------------

[](#configuration---optional)

Copy the config file into your project by running

```
php artisan vendor:publish --provider="Thomaswelton\LaravelGravatar\LaravelGravatarServiceProvider"

```

### Default Image

[](#default-image)

Update the config file to specify the default avatar size to use and a default image to be return if no Gravatar is found.

Allowed defaults:

- (string) ``: the URL to an image of your choice (publicly available, with an image extension and without a query string).
- (string) `404`: do not load any image if none is associated with the email hash, instead return an HTTP 404.
- (string) `mm`: (mystery-man) a simple, cartoon-style silhouetted outline of a person (does not vary by email hash).
- (string) `identicon`: a geometric pattern based on an email hash.
- (string) `monsterid`: a generated 'monster' with different colors, faces, etc.
- (string) `wavatar`: generated faces with differing features and backgrounds.
- (string) `retro`: awesome generated, 8-bit arcade-style pixelated faces.

Example images can be viewed on [the Gravatar website](https://gravatar.com/site/implement/images/#default-image).

### Content Ratings

[](#content-ratings)

By default only "G" rated images will be shown. You can change this system wide in the config file by editing `'maxRating' => 'g'` allowed values are

- `g`: suitable for display on all websites with any audience type.
- `pg`: may contain rude gestures, provocatively dressed individuals, the lesser swear words, or mild violence.
- `r`: may contain such things as harsh profanity, intense violence, nudity, or hard drug use.
- `x`: may contain hardcore sexual imagery or extremely disturbing violence.

The content rating can be changed by changing the `$rating` argument when calling `Gravatar::src` or `Gravatar::image`.

Usage
-----

[](#usage)

### Gravatar::exists($email)

[](#gravatarexistsemail)

Returns a boolean telling if the given `$email` has got a Gravatar.

### Gravatar::src($email, $size = null, $rating = null)

[](#gravatarsrcemail-size--null-rating--null)

Returns the https URL for the Gravatar of the email address specified. Can optionally pass in the size required as an integer. The size will be contained within a range between 1 - 512 as gravatar will no return sizes greater than 512 of less than 1

```

```

### Gravatar::image($email, $alt = null, $attributes = \[\], $rating = null)

[](#gravatarimageemail-alt--null-attributes---rating--null)

Returns the HTML for an `` tag

```
// Show image with default dimensions
echo Gravatar::image('thomaswelton@me.com');

// Show image at 200px
echo Gravatar::image('thomaswelton@me.com', 'Some picture', ['width' => 200, 'height' => 200]);

// Show image at 512px scaled in HTML to 1024px
echo Gravatar::image('thomaswelton@me.com', 'Some picture', ['width' => 1024, 'height' => 1024]);
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~269 days

Recently: every ~362 days

Total

9

Last Release

2415d ago

Major Versions

0.1.0 → 1.0.02015-05-14

1.1.3 → 2.0.02019-10-02

PHP version history (2 changes)0.0.1PHP &gt;=5.3.0

1.0.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104549?v=4)[Steven Richardson](/maintainers/richdynamix)[@richdynamix](https://github.com/richdynamix)

---

Top Contributors

[![thomaswelton](https://avatars.githubusercontent.com/u/678372?v=4)](https://github.com/thomaswelton "thomaswelton (20 commits)")[![AntoineAugusti](https://avatars.githubusercontent.com/u/295709?v=4)](https://github.com/AntoineAugusti "AntoineAugusti (13 commits)")[![trizz](https://avatars.githubusercontent.com/u/832056?v=4)](https://github.com/trizz "trizz (3 commits)")[![KhaledSMQ](https://avatars.githubusercontent.com/u/8835798?v=4)](https://github.com/KhaledSMQ "KhaledSMQ (1 commits)")[![olssonm](https://avatars.githubusercontent.com/u/907114?v=4)](https://github.com/olssonm "olssonm (1 commits)")[![WaveHack](https://avatars.githubusercontent.com/u/1611537?v=4)](https://github.com/WaveHack "WaveHack (1 commits)")[![emilsundberg](https://avatars.githubusercontent.com/u/215958?v=4)](https://github.com/emilsundberg "emilsundberg (1 commits)")[![KennedyTedesco](https://avatars.githubusercontent.com/u/999232?v=4)](https://github.com/KennedyTedesco "KennedyTedesco (1 commits)")

---

Tags

laravellaravel5gravatar

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laravolt/avatar

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

2.0k5.4M31](/packages/laravolt-avatar)[brexis/laravel-workflow

Integerate Symfony Workflow component into Laravel.

283125.6k](/packages/brexis-laravel-workflow)[leantony/laravel-grid

A grid view for laravel, inspired by the yii2 grid widget

9060.2k](/packages/leantony-laravel-grid)

PHPackages © 2026

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