Download the PHP package mapo-89/laravel-avatar-manager without Composer

On this page you can find all versions of the php package mapo-89/laravel-avatar-manager. 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 laravel-avatar-manager

Laravel Avatar Manager

Latest Version on Packagist PHP Laravel Total Downloads GitHub Actions GitHub issues GitHub stars Last commit

Buy Me a Coffee

Self-hosted avatar URLs based on normalized email hashes, with local or remote Laravel filesystem storage, Jetstream profile photos, and optional CorePanel / Spatie Media Library integration.

Deutsche Dokumentation

Requirements

CorePanel and Spatie Media Library are optional. Ordinary profile management is provided by your application; this package adds public hash-based retrieval and an API-key-protected upload endpoint.

Installation

Laravel discovers the service provider and LaravelAvatarManager facade alias automatically. Configuration and assets work directly from the package.

Configuration

Publish only the overrides your application needs:

Option Default Purpose
disk public Disk for API-uploaded avatars.
user_model null Override the model from auth.providers.users.model.
profile_photo_disk null Use Jetstream's configured disk, falling back to public.
media_collection avatars Spatie Media Library collection used by CorePanel.
default_avatar vendor/avatar-manager/default.png Path relative to public; missing files fall back to the bundled image.
api_keys [env('AVATAR_API_KEY')] Nonempty string keys accepted by the upload endpoint.

The hash endpoint streams through Laravel, so storage:link is unnecessary for that endpoint. Applications serving /storage/... URLs directly still need php artisan storage:link on a public local disk.

Usage

Embed the generated URL directly:

GET /avatar/{hash} accepts 32 hexadecimal characters, including uppercase. The hash is md5(strtolower(trim($email))). Images are resolved in this order:

  1. The user's Spatie media image, then their Jetstream profile_photo_path.
  2. An API-uploaded file at avatars/{hash}.{jpg|jpeg|png|gif|webp}.
  3. A published/custom default image, then the bundled default.

Managed profile photos take precedence over older API uploads. User lookup uses the configured model and respects its global scopes, including soft deletion. A hash is a public identifier, not access control or email anonymization.

CorePanel integration

CorePanel stores profile images in Spatie Media Library's avatars collection. The default resolver reads this collection from the configured user model and streams the original image from the media record's disk. No CorePanel dependency or duplicated profile upload is needed in this package. Keep the CorePanel user model configured in auth.providers.users.model, or set user_model explicitly.

For another profile-storage system, bind Mapo89\LaravelAvatarManager\Contracts\ProfilePhotoProviderInterface to your own resolver. Its findForUser(object $user): ?array returns ['disk' => 'disk-name', 'path' => 'relative/path.png'] or null. UserProviderInterface remains available for custom email-hash lookup.

API uploads

Set a strong API key in the host application's .env:

Send a multipart request from a trusted backend:

Keys authorize uploads for any email; keep them out of browser code. Images must be JPEG, PNG, GIF or WebP, at most 2 MiB. SVG and other file types are rejected. Files keep the extension matching their detected image type; superseded extensions are removed after a successful write.

Status Meaning
200 Avatar stored successfully.
401 Missing, invalid or unconfigured API key.
409 A managed profile photo already exists; upload rejected.
422 Invalid email, file type or image size.

This endpoint does not register a user. Without a managed profile image, a later API upload replaces the previous API image for the same email.

Updating existing installations

Laravel 11 and PHP 8.2 are no longer supported. Upgrade the host application to PHP 8.3+ and Laravel 12 or 13 before updating this package. These compatibility changes require the next major package release.

Existing /avatar/{hash} and /api/avatars/upload URLs remain available, and Jetstream integration stays supported. Review these corrected behaviors:

No migration, version preparation or release is performed by an ordinary update.

Development

Tests use SQLite, fake filesystems and real Spatie Media Library records. CI covers Laravel 12/13, supported PHP runtimes, Linux, and both lowest and stable dependencies. Node.js 24+ and Git are needed for release tests:

See shared release guide for commit conventions, dependency updates and releases. The workflow is main → feature/* → release/X.Y.Z → main; direct categorized commits on the release branch are also supported. Keep release PRs draft until the final implementation passes all configured CI, then prepare once and rerun checks. Ordinary commits and pushes do not publish releases. Existing tags stay unchanged; Composer derives versions from immutable vX.Y.Z tags on tested release merges. Published notes must match the prepared CHANGELOG.

Security

Report security issues to [email protected].

Credits and license

Licensed under the MIT License.


All versions of laravel-avatar-manager with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/filesystem Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
illuminate/validation Version ^12.0|^13.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 mapo-89/laravel-avatar-manager contains the following files

Loading the files please wait ...