A simple bundle to create Gravatar links and images.
Drop the Gravatar bundle into your /bundles
directory and register it in your application/bundles.php
file. Optionally you can change the defaults in the config/gravatar.php
file.
You could optionally just drop the gravatar.php
and config file into your Laravel /application/libraries
folder and have it load as needed.
echo Gravatar::get( '[email protected]' );
// http://www.gravatar.com/avatar/4fca794da0cf08804f99048d3c8b39c1?
echo Gravatar::get_image( '[email protected]' );
// <img src="http://www.gravatar.com/avatar/4fca794da0cf08804f99048d3c8b39c1?" alt="">
You can create URLs and IMG tags with Gravatars secure URL.
Gravatar::get_secure( '[email protected]' );
Gravatar::get_secure_image( '[email protected]' );
See the config/gravatar.php
file for full descriptions of config options.
Also see the gravatar.php
file for additional arguments you can pass on a function call.
Thanks to Phill Sparks for implementation ideas, and Michael Owens who created the original.