Download the PHP package chelout/avatar without Composer
On this page you can find all versions of the php package chelout/avatar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chelout/avatar
More information about chelout/avatar
Files in chelout/avatar
Package avatar
Short Description Turn name, email, and any other string into beautiful, initial-based avatar with shadow.
License MIT
Homepage https://github.com/chelout/avatar
Informations about the package avatar
laravolt/avatar
Display unique avatar for any user based on their (initials) name.
Preview
Installation
This package originally built for Laravel, but can also be used in any PHP project.
Read more about integration with PHP project here.
Laravel 5.2/5.3/5.4/5.5:
Laravel 5.1:
Service Provider & Facade
Note: only for Laravel 5.4 and below, because since Laravel 5.5 we use package auto-discovery.
Publish Config (Optional)
This will create config file located in config/laravolt/avatar.php
.
Usage
Output As Base64
Save As File
Output As SVG
Get underlying Intervention image object
The method will return an instance of Intervention image object, so you can use it for further purposes.
Non-ASCII Character
By default, this package will try to output any initials letter as it is. If the name supplied contains any non-ASCII character (e.g. ā, Ě, ǽ) then the result will depend on which font used (see config). It the font supports characters supplied, it will successfully displayed, otherwise it will not.
Alternatively, we can convert all non-ascii to their closest ASCII counterparts. If no closest coutnerparts found, those characters are removed. Thanks to Stringy for providing such useful functions. What we need is just change one line in config/avatar.php
:
Configuration
Overriding config at runtime
We can overriding configuration at runtime by using following functions:
Integration With Other PHP Project
$config
is just an ordinary array with same format as explained above (See Configuration).
All versions of avatar with dependencies
illuminate/support Version 5.8.*
illuminate/cache Version 5.8.*
intervention/image Version ^2.1
danielstjules/stringy Version ~3.1