PHPackages                             drago-ex/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. drago-ex/gravatar

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

drago-ex/gravatar
=================

Simple and customizable Gravatar integration for PHP applications, allowing easy Gravatar image generation based on user email with options for size, default image, and rating.

v1.0.6(1y ago)0198MITPHPPHP &gt;=8.3 &lt;9CI passing

Since May 21Pushed 6d ago1 watchersCompare

[ Source](https://github.com/drago-ex/gravatar)[ Packagist](https://packagist.org/packages/drago-ex/gravatar)[ RSS](/packages/drago-ex-gravatar/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (7)Dependencies (6)Versions (8)Used By (0)

Drago Gravatar
==============

[](#drago-gravatar)

Simple and customizable Gravatar integration for PHP applications.

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://github.com/drago-ex/gravatar/blob/master/license)[![PHP version](https://camo.githubusercontent.com/5b91bf48840637abf7be2eb241f6482d09d35e46036821a020ae76fd56a9d699/68747470733a2f2f62616467652e667572792e696f2f70682f647261676f2d657825324667726176617461722e737667)](https://badge.fury.io/ph/drago-ex%2Fgravatar)[![Tests](https://github.com/drago-ex/gravatar/actions/workflows/tests.yml/badge.svg)](https://github.com/drago-ex/gravatar/actions/workflows/tests.yml)[![Coding Style](https://github.com/drago-ex/gravatar/actions/workflows/coding-style.yml/badge.svg)](https://github.com/drago-ex/gravatar/actions/workflows/coding-style.yml)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- Nette Framework
- Composer

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

[](#installation)

```
composer require drago-ex/gravatar

```

Extension Registration
----------------------

[](#extension-registration)

After installation, register the extension in your Nette configuration (`neon` file):

```
extensions:
	gravatar: Drago\Gravatar\DI\GravatarExtension
```

Optional configuration
----------------------

[](#optional-configuration)

```
gravatar:
	size: 80
	defaultImage: "mm"
	rating: "g"
```

You can adjust the size, `defaultImage`, and rating parameters based on your needs.

Examples
--------

[](#examples)

Once the extension is registered, you can use the Gravatar functionality in your presenters and templates.

Overview
--------

[](#overview)

Drago Gravatar is a simple, customizable solution for integrating Gravatar images into your PHP application. With this package, you can easily generate and display Gravatar images based on user email addresses, allowing you to customize their size, default image, and rating.

Features
--------

[](#features)

- Generate Gravatar images based on user email.
- Customizable image size (from 1 to 2048 pixels).
- Choose a default image if the user has no Gravatar.
- Set image rating (g, pg, r, x).
- Easy integration into your Nette-based application.

Using Gravatar in Presenters
----------------------------

[](#using-gravatar-in-presenters)

Add the GravatarAdapter trait to your presenter:

```
use Drago\Gravatar\GravatarAdapter;

protected function beforeRender(): void
{
	parent::beforeRender();
	$gravatar = $this->gravatar;
	$gravatar->setEmail('someone@somewhere.com');

	$this->template->gravatar = $this->gravatar->getGravatar();
}
```

In Template
-----------

[](#in-template)

In your Latte template, simply output the Gravatar image by using the URL provided by the presenter:

```

```

Customizing Gravatar
--------------------

[](#customizing-gravatar)

You can customize the Gravatar by changing the size, defaultImage, and rating parameters in the configuration:

`size`: The size of the Gravatar image in pixels (1 to 2048). Default is 80. `defaultImage`: The default image used when the user doesn't have a Gravatar (e.g., `mm`, `identicon`, `monsterid`, `wavatar`, etc.). Default is `mm`. `rating`: The rating of the Gravatar image (`g`, `pg`, `r`, `x`). Default is g.

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance74

Regular maintenance activity

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity75

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

Recently: every ~419 days

Total

7

Last Release

478d ago

PHP version history (6 changes)v1.0.0PHP &gt;=7.1

v1.0.2PHP &gt;=7.4

v1.0.3PHP &gt;=8.0

v1.0.4PHP &gt;=8.1

v1.0.5PHP &gt;=8.1 &lt;8.4

v1.0.6PHP &gt;=8.3 &lt;9

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5998929?v=4)[Zdeněk Papučík](/maintainers/accgit)[@accgit](https://github.com/accgit)

---

Top Contributors

[![accgit](https://avatars.githubusercontent.com/u/5998929?v=4)](https://github.com/accgit "accgit (93 commits)")

---

Tags

gravatarnette

### Embed Badge

![Health badge](/badges/drago-ex-gravatar/health.svg)

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

###  Alternatives

[nette/php-generator

🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 8.5 features.

2.2k64.2M576](/packages/nette-php-generator)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[contributte/di

Extra contrib to nette/di

465.8M18](/packages/contributte-di)[contributte/menu-control

Menu control for Nette framework

29108.6k1](/packages/contributte-menu-control)[radekdostal/nette-datetimepicker

DatePicker and DateTimePicker input controls for Nette Framework

13272.2k3](/packages/radekdostal-nette-datetimepicker)[carrooi/nette-menu

Menu control for Nette framework

2950.0k1](/packages/carrooi-nette-menu)

PHPackages © 2026

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