Skip to content

ottaviano/faker-gravatar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gravatar image provider for Faker

Tests Latest Version

It is Gravatar image provider for fzaninotto/Faker fakerphp/faker

Here are some examples of generated avatars:

mp (mode: mp)

identicon (mode: identicon)

monsterid (mode: monsterid)

wavatar (mode: wavatar)

retro (mode: retro)

robohash (mode: robohash)

blank (mode: blank, transparent image)

Requirements

  • PHP >= 7.1|8.0

Installation

composer require ottaviano/faker-gravatar --dev

Usage

<?php

// ...

$faker = Faker\Factory::create();
$faker->addProvider(new Ottaviano\Faker\Gravatar($faker));

$imageLocalPath = $faker->gravatar();
$imageContent = file_get_contents($imageLocalPath);

// OR

$imageUrl = $faker->gravatarUrl();