sampic/laravel-adorableavatars

This package is abandoned and no longer maintained. No replacement package was suggested.

Laravel extension allowing you to generate an avatar based on the site http://avatars.adorable.io/

1.0.0 2019-04-28 19:47 UTC

This package is auto-updated.

Last update: 2021-03-29 00:45:01 UTC


README

Build Status Latest Stable Version Total Downloads

Installation

Update your composer.json file to include this package as a dependency

"sampic/laravel-adorableavatars": "~1.0"

This package supports the package discovery functionality provided in Laravel 5.5, so registering the classes as described below is no longer necessary if you use Laravel 5.5.

Register the Adorable Avatars service provider by adding it to the providers array in the config/app.php file.

Sampic\LaravelAdorableAvatars\LaravelAdorableAvatarsServiceProvider::class

Alias the Adorable Avatars facade by adding it to the aliases array in the config/app.php file.

'aliases' => [
     'AdorableAvatars' => Sampic\LaravelAdorableAvatars\Facades\AdorableAvatars::class
]

Configuration (optionnal !)

Update the config file to specify this size by default.

php artisan vendor:publish --provider="Sampic\LaravelAdorableAvatars\LaravelAdorableAvatarsServiceProvider"

Default configuration :

  • (boolean) hash_string (default: true): Hide the content that allows you to generate your avatar
  • (boolean) secure_url (default: true): allows to use the API in https
  • (integer) size: (default: 80) the default size of the generated avatar

Usage

AdorableAvatars::src(string string, int $size = null)

Returns the URL of the image that has been generated thanks to the character string Can optionally pass in the size required as an integer. The size will be contained within a range between 1 - 512 as avatar will no return sizes greater than 512 of less than 1

<!-- Show image with default dimensions -->
<img src="{{ AdorableAvatars::src('helloworld') }}">

<!-- Show image at 200px -->
<img src="{{ AdorableAvatars::src('helloworld', 200) }}">