Posts Learn Components Snippets Categories Tags Tools About

How to Show Gravatar Image on Laravel 8

Learn how to render and show gravatar image on Laravel 8 to show a picture of your user

Created on Jul 07, 2021


To render any of the gravatar image from Laravel, you can make use of "creativeorange/gravatar" package. The steps are very simple so let's get started.

1 - Install the Dependency
composer require creativeorange/gravatar ~1.0

2 - Call the Helper Function
To show and render the image, call the Gravatar helper function.
@if (Gravatar::exists('[email protected]'))
    <img src="{{ Gravatar::get('[email protected]') }}" />

If there is no image found, you can use the fallback and provide a URL to the default image.
Gravatar::fallback('')->get('[email protected]');

If you like our tutorial, do make sure to support us by being our Patreon or buy us some coffee ☕️

Load comments for How to Show Gravatar Image on Laravel 8