Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 1.73 KB

README.md

File metadata and controls

50 lines (35 loc) · 1.73 KB

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();