Download the PHP package martian/laravatar without Composer

On this page you can find all versions of the php package martian/laravatar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravatar

Laravatar

Latest Version on Packagist Total Downloads GitHub Actions

🚀 A lightweight and easy-to-use Laravel package designed to simplify avatar generation for your Eloquent models. It provides a flexible and extensible solution for generating avatars using Gravatar, DiceBear, UI Avatars or Boring Avatar

Supported Avatar Drivers

Driver Description Supported Link
Gravatar Gravatar is a service for providing globally unique avatars. Yes ✅️ Gravatar
DiceBear DiceBear is an avatar library for designers and developers. Yes ✅️ DiceBear
UI Avatars UI Avatars is an avatar library for designers and developers. Yes ✅️ UI Avatars
Boring Avatar Boring avatars is a tiny JavaScript React library that generates custom, SVG-based, round avatars from any username and color palette. Yes ✅️ Boring Avatar

[!NOTE] You can also add your own custom driver by implementing the AmplifiedHQ\Laravatar\Contracts\AvatarInterface; interface and extending the AmplifiedHQ\Laravatar\Abstracts\BaseAvatar class.

Installation

Note: This package requires PHP 7.4 or higher. You can install the package via composer:

Register Service Provider

Add the service provider to the providers array in config/app.php:

Publish Configuration File

Publish the configuration file using the following command:

Configuration

You can configure the package by editing the config/laravatar.php file.

Usage

In order to use the package in your model to generate an avatar on the fly, you need to add the AmplifiedHQ\Laravatar\Traits\HasAvatar trait to your model.

Using the HasAvatar trait

[!IMPORTANT] If you are using the gravatar driver, you need to use the email column as the avatar column. If you are using the dicebear or ui-avatars or boringavatar driver, you can use any column as the avatar column, provided that the column is a string column. (e.g. name, email, username etc.)

[!WARNING] The HasAvatar trait requires you to define the $avatarColumn and $avatarStorageColumn properties in your model. The $avatarColumn property is the column that will be used to generate the avatar. The $avatarStorageColumn property is the column that will be used to store the avatar.

Using the Driver Methods

You can also use each driver method directly on your application either on on your controller, model or view.

Gravatar

DiceBear

Boring Avatar

UI Avatars

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravatar with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
illuminate/support Version ^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package martian/laravatar contains the following files

Loading the files please wait ....