2017 © Pedro Peláez
 

library gravatar

Gravatar for Laravel 5.0.x through 5.5.x package for retrieving gravatar image URLs or checking the existance of an image.

image

creativeorange/gravatar

Gravatar for Laravel 5.0.x through 5.5.x package for retrieving gravatar image URLs or checking the existance of an image.

  • Thursday, May 17, 2018
  • by creativeorange
  • Repository
  • 6 Watchers
  • 231 Stars
  • 578,241 Installations
  • PHP
  • 40 Dependents
  • 0 Suggesters
  • 25 Forks
  • 5 Open issues
  • 16 Versions
  • 14 % Grown

The README.md

Gravatar for Laravel 5

Installation

First, pull in the package through Composer via the command line:, (*1)

composer require creativeorange/gravatar

or add the following to your composer.json file and run composer update., (*2)

"require": {
    "creativeorange/gravatar": "~1.0"
}

Then include the service provider within app/config/app.php., (*3)

'providers' => [
    'Creativeorange\Gravatar\GravatarServiceProvider'
];

If you want to use the facade, add this to de bottom of app/config/app.php And, for convenience, add a facade alias to this same file at the bottom:, (*4)

'aliases' => [
    'Gravatar' => 'Creativeorange\Gravatar\Facades\Gravatar',
];

Finally, publish the config by running the php artisan vendor:publish command, (*5)

Usage

Within your controllers or views, you can use, (*6)

    Gravatar::get('email@example.com');

this will return the URL to the gravatar image of the specified email address. In case of a non-existing gravatar, it will return return a URL to a placeholder image. You can set the type of the placeholder in the configuration option fallback. For more infomation, visit http://en.gravatar.com/site/implement/images/#default-image, (*7)

Alternatively, you can check for the existance of a gravatar image by using, (*8)

    Gravatar::exists('email@example.com');

This will return a boolean (true or false)., (*9)

Or you can pass a url to a custom image using the fallback method:, (*10)

    Gravatar::fallback('http://urlto.example.com/avatar.jpg')->get('email@example.com');

Configuration

You can create different configuration groups to use within your application and pass the group name as a second parameter to the get-method: There is a default group in config/gravatar.php which will be used when you do not specify a second parameter., (*11)

If you would like to add more groups, feel free to edit the config/gravatar.php file. For example:, (*12)

return array(
    'default' => array(
        'size'   => 80,
        'fallback' => 'mm',
        'secure' => false,
        'maximumRating' => 'g',
        'forceDefault' => false,
        'forceExtension' => 'jpg',
    ),
    'small-secure' => array (
        'size'   => 30,
        'secure' => true,
    ),
    'medium' => array (
        'size'   => 150,
    )
);

after that, you can use the following syntax:, (*13)

Gravatar::get('email@example.com', 'small-secure'); // will use the small-secure group
Gravatar::get('email@example.com', 'medium'); // will use the medium group
Gravatar::get('email@example.com', 'default'); // will use the default group
Gravatar::get('email@example.com'); // will use the default group

The Versions

17/05 2018

1.0.x-dev

1.0.9999999.9999999-dev

Gravatar for Laravel 5.0.x through 5.5.x package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

30/03 2018

v1.0.11

1.0.11.0

Gravatar for Laravel 5.0.x through 5.5.x package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

29/03 2018

dev-https-everywhere

dev-https-everywhere

Gravatar for Laravel 5.0.x through 5.5.x package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

09/08 2017

v1.0.10

1.0.10.0

Gravatar for Laravel 5.0.x through 5.5.x package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

09/08 2017

v1.0.9

1.0.9.0

A Laravel 5.0, 5.1, 5.2 and 5.3 gravatar package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

08/08 2017

dev-master

9999999-dev

A Laravel 5 gravatar package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

15/02 2017

1.0.10

1.0.10.0

A Laravel 5.0, 5.1, 5.2 and 5.3 gravatar package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

27/07 2016

1.0.9

1.0.9.0

A Laravel 5.0, 5.1, 5.2 and 5.3 gravatar package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

22/12 2015

v1.0.8

1.0.8.0

A Laravel 5.0, 5.1 and 5.2 gravatar package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

22/12 2015

v1.0.7

1.0.7.0

A Laravel 5.0, 5.1 and 5.2 gravatar package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

25/08 2015

v1.0.6

1.0.6.0

A Laravel 5.0 & 5.1 gravatar package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

09/06 2015

v1.0.5

1.0.5.0

A Laravel 5.0 & 5.1 gravatar package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

09/06 2015

v1.0.4

1.0.4.0

A Laravel 5.0 & 5.1 gravatar package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

09/06 2015

v1.0.3

1.0.3.0

A Laravel 5 gravatar package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

19/03 2015

v1.0.2

1.0.2.0

A Laravel 5 gravatar package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar

19/03 2015

v1.0.0

1.0.0.0

A Laravel 5 gravatar package for retrieving gravatar image URLs or checking the existance of an image.

  Sources   Download

MIT

The Requires

 

laravel avatar gravatar