PHP code example of creativeorange / gravatar

1. Go to this page and download the library: Download creativeorange/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/ */

    

creativeorange / gravatar example snippets


'providers' => [
    'Creativeorange\Gravatar\GravatarServiceProvider'
];

'providers' => [
    Creativeorange\Gravatar\GravatarServiceProvider::class
];

'aliases' => [
    'Gravatar' => 'Creativeorange\Gravatar\Facades\Gravatar',
];

'aliases' => [
    'Gravatar' => Creativeorange\Gravatar\Facades\Gravatar::class,
];

    Gravatar::get('[email protected]');

    Gravatar::exists('[email protected]');

    Gravatar::fallback('http://urlto.example.com/avatar.jpg')->get('[email protected]');

return array(
	'default' => array(
		'size'   => 80,
		'fallback' => 'mm',
		'secure' => false,
		'maximumRating' => 'g',
		'forceDefault' => false,
		'forceExtension' => 'jpg',
	),
	'small-secure' => array (
	    'size'   => 30,
	    'secure' => true,
	),
	'medium' => array (
	    'size'   => 150,
	)
);

Gravatar::get('[email protected]', 'small-secure'); // will use the small-secure group
Gravatar::get('[email protected]', 'medium'); // will use the medium group
Gravatar::get('[email protected]', 'default'); // will use the default group
Gravatar::get('[email protected]'); // will use the default group

Gravatar::get('[email protected]', ['size'=>200]);