taskforcedev / gravatar by PrivateSniper

Gravatar Module.
229
0
2
Package Data
Maintainer Username: PrivateSniper
Package Create Date: 2015-08-18
Package Last Update: 2016-08-25
Language: PHP
License: GPL-3.0
Last Refreshed: 2024-04-15 03:04:50
Package Statistics
Total Downloads: 229
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Gravatar

A simple gravatar class.

Installation

Step 1: Add the following package to your composer.json.

require {
  "taskforcedev/gravatar": "1.0.*",
}

Step 2: Run composer update.

composer update

Usage

Using the class is as very straightforward.

Example

use Taskforcedev\Gravatar;

$gravatar = new Gravatar();

$avatar = $gravatar->getAvatar($user, $options);

$user can be any of the following:

  • An array with a key containing the email address.
  • A Laravel User object.
  • A class with a getEmail() method or email property.

$options is optional

  • $options['secure'] - By default this is true for https but can also be set to false for http.
  • $options['size'] - Defaults to 100 (px), accepts any int value.

Exceptions

If for any reason the class fails to retrieve a gravatar false will be returned.