ottaviano/faker-gravatar

Faker Gravatar image provider

0.2.0 2022-07-21 13:37 UTC

This package is auto-updated.

Last update: 2024-12-21 19:04:22 UTC


README

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