PHP Avataaar
PHP library for generating random avatars based on avataaars.
Installation
Dependencies
- PHP 8.0
- Composer 2.0
Install
Install the library via composer
composer require johnciacia/avataaar
Usage
Basic Usage
$avataaar = new \Avataaar\Avataaar();
$avataaar->url();
Faker
$faker = (new \Faker\Factory())::create();
$faker->addProvider(new \Avataaar\FakerProvider($faker));
echo $faker->avataaar;
Laravel
When using Laravel, this package will be discovered automatically and added to the applications Faker instance. Just call avataaar
on the Faker instance and a random image URL will be generated.
$this->faker->email,
'avatar_url' => $this->faker->avataaar,
'bio' => $this->faker->sentence,
];
}
}