jejje/gravatar

A very simple package to get a Gravatar image or Profile. Made for education purposes for http://jejje.net

1.0.0 2015-07-13 12:53 UTC

This package is not auto-updated.

Last update: 2024-04-13 16:18:07 UTC


README

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

This package is part of a simple tutorial from JejjE's network and and will give you a few simple methods you can call to get a users Gravatar image. Read the Tutorial here

Installation

First you'll need to pull in the package via composer

"require": {
    "jejje/gravatar": "dev-master"
}

And in your app/config/app.php you'll need to add the Service Provider.

'providers' => [
    'Jejje\Gravatar\GravatarServiceProvider::class'
];

Usage

You can use it either within your Controller or your View like so.

public function index() {
    $email = 'jejje@jejje.net';
    $size = 100; // Optional, you may set a default in the config file
    Gravatar::getImageWithLinkToProfile($email, $size);
}

Other methods that are for your disposal are

  • Gravatar::getProfileUrl($email)
  • Gravatar::getImageUrl($email, $size)
  • Gravatar::getHash($email)