Skip to content

humans/avatars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Humans — Default Avatars

This package allows downloads from multiple providers and it returns the first successful result.

Setup

composer require humans/avatars

Usage

This will return the first successful photo.

use Humans\Avatars\Facades\Avatars;
use Humans\Avatars\Attempt;
use Humans\Avatars\Providers;

$response = Avatars::attempt(
    new Providers\Unavatar('[email protected]'),
    new Providers\Unavatar('jaggy'),
    new Providers\Unavatar('[email protected]'),
    new Providers\UiAvatars('Jaggy Gauran'),
);

$response->contents;
$response->extension;

Testing

Avatars provides two testing fakes to make testing a lot easier.

Force a success with specific contents

Avatars::pass('example image content', 'gif');

Force the avatar to fail

Avatars::fail();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages