2017 © Pedro Peláez
 

library gravatar

Simple transformer to get a gravatar url on a User model

image

dionbosschieter/gravatar

Simple transformer to get a gravatar url on a User model

  • Sunday, November 15, 2015
  • by dionbosschieter
  • Repository
  • 1 Watchers
  • 0 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Gravatar

Install Gravatar using composer: composer require dionbosschieter/gravatar, (*1)

Implement the avataruserinterface on your users model use Gravatar\UserGravatarInterface, (*2)

The gravatar class expects a getEmailAdres method on your user model, (*3)

<?php

use Gravatar\UserGravatarInterface;

class User extends Model  
{

  public function getEmailAdres()
  {
      return $this->email;
  }
}

Usage

$avatar = new \Gravatar\Gravatar($usermodel);
$avatar->getImageUrl();
$avatar->getImageUrlForSize();

Register the class using your frameworks dependency container:, (*4)

// Laravel
App::bind('gravatar', function()
{
    $grav = new \Gravatar\Gravatar(app('auth')->user());

    return $grav;
});

The Versions

15/11 2015

dev-master

9999999-dev

Simple transformer to get a gravatar url on a User model

  Sources   Download

MIT

The Development Requires

by Avatar dionbosschieter

laravel gravatar

15/11 2015

0.2

0.2.0.0

Simple transformer to get a gravatar url on a User model

  Sources   Download

MIT

The Development Requires

by Avatar dionbosschieter

laravel gravatar

14/11 2015

0.1

0.1.0.0

Simple transformer to get a gravatar url on a User model

  Sources   Download

MIT

The Development Requires

by Avatar dionbosschieter

laravel gravatar