PHP code example of dionbosschieter / gravatar

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

    

dionbosschieter / gravatar example snippets




use Gravatar\UserGravatarInterface;

class User extends Model  
{
  
  public function getEmailAdres()
  {
      return $this->email;
  }
}

$avatar = new \Gravatar\Gravatar($usermodel);
$avatar->getImageUrl();
$avatar->getImageUrlForSize();

// Laravel
App::bind('gravatar', function()
{
    $grav = new \Gravatar\Gravatar(app('auth')->user());

    return $grav;
});