Download the PHP package black-sheep-tech/laravel-ui-avatars without Composer
On this page you can find all versions of the php package black-sheep-tech/laravel-ui-avatars. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download black-sheep-tech/laravel-ui-avatars
More information about black-sheep-tech/laravel-ui-avatars
Files in black-sheep-tech/laravel-ui-avatars
Package laravel-ui-avatars
Short Description A simple service provider/wrapper for the UI Avatars API (https://ui-avatars.com).
License MIT
Informations about the package laravel-ui-avatars
Laravel UiAvatars is a PHP library for Laravel used to generate avatar using the UI Avatars API (https://laravel-ui-avatars.com). This package provides a simple, fluent interface for customizing avatar parameters and generating the corresponding URL. It also allows downloading and saving the avatars locally.
Installation
You can install the package via Composer:
Usage
Basic Usage / Url Generation
With all customizations
Download Avatar
To download the avatar directly:
Save Avatar Directly to Disk
To save the avatar to a specific location:
Customization
The UiAvatarsService
class allows for various customizations:
- name: Sets the name from which the initials are generated.
- background: Sets the background color (hex code or 'random')(default: random).
- color: Sets the font color (hex code)(default: 8b5d5d).
- size: Sets the size of the avatar in pixels (16 to 512)(default: 64).
- fontSize: Sets the font size ratio (0.1 to 1.0)(default: 0.5).
- length: Sets the number of characters for initials (default: 2).
- rounded: Enables rounded avatars (default: false).
- bold: Enables bold text for initials (default: false).
- uppercase: Converts initials to uppercase (default: true).
- format: Sets the format of the avatar ('png' or 'svg')(default: png).
Requirements
- PHP 8.0 or higher
- Laravel framework version 9.0 or higher
License
This package is open-sourced software licensed under the MIT license.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request on GitHub.