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

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

foinikas/gravatar
=================

A fast way to create Gravatars using Laravel framework

06101PHPCI failing

Since Jul 28Pushed 11y ago1 watchersCompare

[ Source](https://github.com/fakiolinho/laravel-gravatar)[ Packagist](https://packagist.org/packages/foinikas/gravatar)[ RSS](/packages/foinikas-gravatar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Gravatar
================

[](#laravel-gravatar)

[![Travis CI](https://camo.githubusercontent.com/4a0001c1e4d93d490465387396ba5bfd076e9b444e96b764619122597fd572ee/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f6a6f79656e742f6e6f64652f76302e362e737667)](https://travis-ci.org/fakiolinho/laravel-gravatar) [![MIT](https://camo.githubusercontent.com/9000e3c155306ff0defdd0fa486a321ac5f3e90b5a7bd73ac7ced83640a6fd05/687474703a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f657870726573732e737667)](http://opensource.org/licenses/MIT)

Laravel Gravatar is a very easy way to call gravatars with fallback images quite fast and efficiently while using Laravel 4 framework.

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

[](#installation)

Begin by installing this package through Composer. Edit your project's composer.json file to require foinikas/gravatar.

```
"require": {
    "foinikas/gravatar": "dev-master"
}

```

Next, update Composer from the Terminal:

```
composer update

```

Once this operation completes, the final step is to add the service provider. Open `app/config/app.php`, and add a new item to the providers array.

```
'Foinikas\Gravatar\GravatarServiceProvider'

```

Do not worry about registering any Facade as it will register automatically a new Facade named `Gravatar` for you.

Use Gravatar
------------

[](#use-gravatar)

Provided methods:

- Gravatar::image('');
- Gravatar::url('');
- Gravatar::hash('');

Ready to call your first gravatar? Ok just create a gravatar image:

```
Gravatar::image('my@email.com');

```

or maybe just a gravatar url is ok:

```
Gravatar::url('my@email.com');

```

That's it. Your gravatar was created!

In case you need only the hashed email address of yours:

```
Gravatar::hash('my@email.com');

```

Easy enough right?

Parameters
----------

[](#parameters)

Gravatar's `image` method can accept quite a few options:

```
Gravatar::image($email, array $attrs = null, $size = 50, $default = null, $r = 'g', $secure = false);

```

Gravatar's `url` method can accept almost the same except for the `$attrs` array:

```
Gravatar::url($email, $size = 50, $default = null, $r = 'g', $secure = false);

```

Gravatar's `hash` method accepts only the email address as a parameter:

```
Gravatar::hash($email);

```

### email

[](#email)

User's email address.

Note: If an invalid email address is provided an exception will be thrown.

Default value: not provided

### attributes

[](#attributes)

Attributes for the created img tag. Usage:

```
['class' => 'myClass', 'id' => 'myId'];

```

Default value: null

### size

[](#size)

An integer that demonstrates the gravatar's size you want.

Default value: 50

### default

[](#default)

This is the fallback image in case there is not a valid gravatar for the provided email address. This can be either the default Gravatar logo if default parameter is left blank or can be one of the many options Gravatar's api provides:

```
'404', 'mm', 'identicon', 'monsterid', 'wavatar', 'retro', 'blank'

```

or also it could be a custom image's url you may choose to provide:

```
'img/myimage.jpg'

```

In case you provide a custom image then the package shall create a full path to it using Laravel's `URL::asset()` method.

Default value: null (Gravatar logo)

### rating

[](#rating)

Gravatar's rating option. Gravatar's api options:

```
'g', 'pg', 'r', 'x'

```

Default value: 'g'

### secure

[](#secure)

If you're displaying Gravatars on a page that is being served over SSL, then you'll want to serve your Gravatars via SSL as well. To achieve this just set this to true.

Default value: false

License
-------

[](#license)

All code created by foinikas is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

For more information about the default options Gravatar's API provides visit [Gravatar](http://el.gravatar.com/site/implement/)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/55d1f7c1e49e8b3591097eafa6c1d4b71874fe987ac088eefe26dd59c03d983e?d=identicon)[fakiolinho](/maintainers/fakiolinho)

---

Top Contributors

[![fakiolinho](https://avatars.githubusercontent.com/u/2962687?v=4)](https://github.com/fakiolinho "fakiolinho (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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