Download the PHP package laravolt/avatar without Composer
On this page you can find all versions of the php package laravolt/avatar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package avatar
laravolt/avatar
Display unique avatar for any user based on their (initials) name.
Preview
:film_strip: Video Tutorial
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:
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
.
Lumen Service Provider
Usage
Output as base64
Save as file
Output as Gravatar
Gravatar parameter reference: https://docs.gravatar.com/api/avatars/images/
Output as SVG
You may specify custom font-family for your SVG text.
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).
Support Us
Buy Me A Coffee
Donate Via PayPal
Traktir Saya
All versions of avatar with dependencies
illuminate/support Version ^10.0|^11.0
illuminate/cache Version ^10.0|^11.0
intervention/image Version ^3.4