PHP code example of mybb / gravatar

1. Go to this page and download the library: Download mybb/gravatar library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mybb / gravatar example snippets


'providers' => [
    ...
    'MyBB\Gravatar\Providers\GravatarServiceProvider',
    ...
],
'aliases' => [
    ...
    'Gravatar' => 'MyBB\Gravatar\Facades\GravatarFacade',
    ...
],



rator = new \MyBB\Gravatar\Generator();

$gravatarUrl = $generator->getGravatar('[email protected]');

// OR set some options and fetch:

$generator->setSecure(false)->setExtension('jpg')->setSize(32)->setDefault('identicon')->setEmail('[email protected]');
$gravatarUrl = (string) $generator;

// OR call using Laravel's facade

$gravatarUrl = Gravatar::setSize(32)->getGravatar('[email protected]');

bash
php artisan vendor:publish --provider='MyBB\Gravatar\Providers\GravatarServiceProvider'