Laravel Gravatar Helper is a good package that we can use to generate Gravatar avatar URL, with multiple connections support.

laravel gravatar

Installation

You can install this package using:

$ composer require elfsundae/laravel-gravatar

Then copy the configuration file to your application:

$ cp vendor/elfsundae/laravel-gravatar/config/gravatar.php config/gravatar.php

For Lumen, you need to load the configuration file in bootstrap/app.php :

$app->configure('gravatar');

Source Code

https://github.com/ElfSundae/laravel-gravatar