LaravelPackages.net
Acme Inc.
Toggle sidebar
taskforcedev/gravatar

Gravatar Module.

235
0
v1.0.0
About taskforcedev/gravatar

taskforcedev/gravatar is a Laravel package for gravatar module.. It currently has 0 GitHub stars and 235 downloads on Packagist (latest version v1.0.0). Install it with composer require taskforcedev/gravatar. Discover more Laravel packages by taskforcedev or browse all Laravel packages to compare alternatives.

Last updated

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.

Comments