Home / Snippets / How to Show Gravatar Image on Laravel 8
How to Show Gravatar Image on Laravel 8 cover

How to Show Gravatar Image on Laravel 8

248

3 years ago

0 comments

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]') }}" />
@endif

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

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

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

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this