Gravatar is a service that offers distinctive worldwide avatars and has integrated it into their blogging platform If they have registered on and you don't have an avatar image, you can receive a Gravatar src image from their email. Therefore, it is quite simple to implement in your Laravel application. There are a number of packages for using Gravatar images with Laravel, but we'll pick the one that's, in my opinion, the best: thomaswelton/laravel-gravatar.

Installation Package

composer require thomaswelton/laravel-gravatar

Once this package has been installed, enter the config/app.php file and add the service provider and alias.


'providers' => [
'aliases' => [
	'Gravatar' => Thomaswelton\LaravelGravatar\Facades\Gravatar::class

Okay, so here's how we can use Gravatar in our blade file:

Use In Blade File

You can use it in your application now by doing as follows:

If the $email is linked to Gravatar, Gravatar::exists($email) will return boolean, informing you of the situation.

The whole URL for the Gravatar registered email address will be returned by the command Gravatar::src($email, $size = null, $rating = null).

<img src="{{ Gravatar::src('', 200) }}">

We hope that the code and information in this post will help you use the thomaswelton/laravel-gravatar package to load a gravatar image in Laravel 9. If you require assistance or have any comments or suggestions regarding this post, please share them in the comment area.

Recommended Posts

View All

Laravel 9 Autocomplete Search using Typeahead JS Tutorial

Laravel 8 autocomplete search using Typehead JS from MySQL database example

Laravel Eloquent Query - Laravel whereKey method

We'll look at the whereKey method in Laravel Eloquent in this post. whereKey is an extremely easy-to-use tool with a lot of potential.

Laravel 9 Ajax Form Validation Example

In Laravel 9, we may ajax submit a form following validation. Laravel's ajax form validation is simple.

Laravel 8 Generate PDF with Graph Tutorial

Laravel 8 generates a graphed pdf. You will understand how to generate a pdf with a graph in the Laravel 8 app in this tutorial

Laravel 8 Generate PDF File using DomPDF | Laravel 8 PDF

How to generate pdf from view, html, blade in laravel 8. Here, we would share with you how to generate pdf file from blade view in laravel 8