Package Data | |
---|---|
Maintainer Username: | pespantelis |
Maintainer Contact: | pespantelis@gmail.com (Pantelis Peslis) |
Package Create Date: | 2015-06-22 |
Package Last Update: | 2015-06-22 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-19 03:08:55 |
Package Statistics | |
---|---|
Total Downloads: | 162 |
Monthly Downloads: | 4 |
Daily Downloads: | 0 |
Total Stars: | 5 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Gravatar is a service for providing globally unique avatars.
Begin by installing this package through Composer.
composer require pespantelis/gravatar
<?php
// require the Gravatar autoloader
require 'vendor/autoload.php';
// set options (optional)
$options = [
'size' => 256,
'default-image' => 'identicon',
'force-default' => false,
'rating' => 'pg',
'secure' => true
];
$gravatar = new Peslis\Gravatar\Factory($options);
echo $gravatar->url('pespantelis@gmail.com');
echo $gravatar->exists('pespantelis@gmail.com');
// or
echo $gravatar->url('pespantelis@gmail.com')->exists();
// size
echo $gravatar->url('pespantelis@gmail.com', 256);
// or
echo $gravatar->url('pespantelis@gmail.com')->size(256);
// secure requests
echo $gravatar->url('pespantelis@gmail.com')->secure();
// default image
echo $gravatar->url('pespantelis@gmail.com')->defaultImage('identicon');
// force default image
echo $gravatar->url('pespantelis@gmail.com')->forceDefault();
// rating level
echo $gravatar->url('pespantelis@gmail.com')->rating('pg');
echo $gravatar->url('pespantelis@gmail.com', 256)->defaultImage('identicon')->rating('pg');
If you are a Laravel user, there is a README.md here.
Gravatar is released under the MIT Licence. See the bundled LICENSE file for details.