Download the PHP package laravel-enso/avatars without Composer

On this page you can find all versions of the php package laravel-enso/avatars. 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 avatars

Avatars

Stable Downloads Issues Merge Requests

Description

Avatars is Laravel Enso's user avatar package.

It attaches one avatar record to each user, exposes authenticated endpoints for viewing, uploading, and regenerating avatars, and integrates with Enso's file pipeline so custom uploads are stored and transformed consistently.

The package also generates default avatars automatically. It prefers Gravatar when a public image exists for the user's email address and falls back to an SVG rendered on demand with Laravolt when it does not. SVG fallbacks do not create image files or file records.

The frontend integration lives primarily in the Enso user profile experience and reusable avatar components from @enso-ui/users.

Installation

This package comes pre-installed in Laravel Enso applications that support user profile avatars.

For standalone installation in an Enso-based application:

The package auto-registers its service providers, loads migrations, registers API routes, observes user creation, and exposes the avatar generation command.

The current release uses Laravolt Avatar 6.5 and Laravel Enso Image Transformer 2.5.6, both backed by Intervention Image 4.

Run the migrations after installation:

If you need the package storage scaffolding, publish it with:

Publish the avatar configuration with:

Set enso.avatars.useGravatar to false to use SVG fallbacks without probing Gravatar. The option defaults to true.

Set enso.avatars.background to change the shared SVG background color (default: #64748b). The legacy laravolt.avatar.backgrounds palette is ignored for these fallbacks. Initials reflect the user's current name and are escaped for XML.

Features

Usage

The package binds an avatar() relation and generateAvatar() method to the Enso user model:

Store a custom uploaded avatar for the authenticated user:

Regenerate the default avatar:

Display an avatar in the browser by hitting the show endpoint:

::: warning Note The package is designed to work with a single avatar per user. When you regenerate or upload a new avatar, the previously attached file is removed automatically. :::

API

Routes

All package routes are registered under:

Endpoints:

Authorization

LaravelEnso\Avatars\Policies\AvatarPolicy

Model

LaravelEnso\Avatars\Models\Avatar

Persisted fields:

Relationships:

Useful methods:

Dynamic User Integration

Dynamic additions on LaravelEnso\Users\Models\User:

Command

Generate missing avatars for users without one:

Upgrading to 4.6

Update the package, then run the standard Enso upgrade command:

The LegacyAvatars upgrade replaces legacy candidates with SVG fallbacks and permanently deletes their file records and stored images. It selects avatars without a remote URL whose attached file belongs to the avatar type, has MIME type image/jpeg, and has the exact original name avatar.<user_id>.jpg.

This naming convention is a heuristic: an uploaded JPEG with that exact name is also deleted. Review candidates and retain a backup before running the upgrade if such uploads may exist. Other uploads and Gravatar URLs are preserved. No file-size or created_by threshold is used.

The upgrade is repeatable and also handles missing physical files. A storage deletion returning false does not stop the upgrade; the avatar association and file record are still removed, so that physical file may remain orphaned.

Existing file-backed avatars continue to display until replaced or processed by the upgrade. New users and explicit default-avatar regeneration use Gravatar or SVG immediately. Both file_id and url are null for an SVG fallback; the avatar record and show endpoint remain available.

Depends On

Required Enso packages:

Companion frontend package:

External dependency:

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!


All versions of avatars with dependencies

PHP Build Version
Package Version
Requires laravel-enso/core Version ^12.0
laravel-enso/dynamic-methods Version ^4.0
laravel-enso/files Version ^5.7
laravel-enso/image-transformer Version ^2.5.6
laravel-enso/migrator Version ^2.0
laravel-enso/users Version ^2.8
laravolt/avatar Version ^6.5
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 laravel-enso/avatars contains the following files

Loading the files please wait ...