Laravel 5 - How to implement gravatar image using thomaswelton/laravel-gravatar package

By Hardik Savani | May 11, 2016 | | 38356 Viewer | Category : Laravel


Gravatar is a service that provide unique globally avatars and integrated it into their WordPress.com blogging platform. If you don't have avatar image then you can get Gravatar src image from thier email if it register on WordPress.com. So if you want to implement in your laravel application then it is very easy. There are several package for Gravatar image for laravel, but we will use thomaswelton/laravel-gravatar package that is i think better.

First fire following command on your terminal.

Installation Package

composer require thomaswelton/laravel-gravatar

After install this package, Now open config/app.php file and add service provider and aliase.

config/app.php

'providers' => [

....

Thomaswelton\LaravelGravatar\LaravelGravatarServiceProvider::class,

],

'aliases' => [

....

'Gravatar' => Thomaswelton\LaravelGravatar\Facades\Gravatar::class

],

ok, now we can use Gravatar in our blade file like this way:

Use In Blade File

<img src="{{ Gravatar::src('itsolutionstuff@gmail.com', 200) }}">

Try this it will help you and for more information click here: laravel-gravatar.



Hardik Savani
My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
Follow Me: Github Twitter
***Do you want me hire for your Project Work? Then Contact US.