PHP code example of danrovito / laravel-gravatar

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

    

danrovito / laravel-gravatar example snippets




namespace App;

use Darovi\Gravatar;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
  use Gravatar;
 
  // ...
}



namespace App;

use Darovi\Gravatar;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
  use Gravatar;
  
  protected function emailAttributeName()
  {
    return 'your_email_column';
  }
  
  // ...
}

<img src="{{ Auth::user()->gravatar }}">