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.
Informations about the package laravel-avatar-manager
Laravel Avatar Manager
Laravel Avatar Manager is a lightweight, self-hosted Laravel package for managing user avatars - with support for Gravatar-compatible hashes, local storage and easy integration into existing projects.
đ This README is also available in đŠđĒ German.
⨠Features
- Avatar URLs based on MD5(Email), as with Gravatar
- Fallback to default avatars
- Seamless integration with the Laravel user model
- Local storage of uploaded avatars
- API-based avatar upload using email + API key (no login required)
- SQLite compatible â
đ API Avatar Upload Endpoint
The package provides an optional upload endpoint without requiring user registration.
POST /api/avatars/upload
Headers:
X-API-KEY: A valid API key defined inconfig/avatar-manager.php
Body Parameters:
email(string, required) â The email address used to compute the avatar hashavatar(image, required) â The uploaded avatar image (max 2MB)
Response:
200 OK: Avatar successfully uploaded401 Unauthorized: Missing or invalid API key422 Unprocessable Entity: Validation failed (e.g. invalid email or image)409 Conflict: Upload aborted â user already has an existing profile photo
âšī¸ If a user exists in your system and already has a
profile_photo_pathset, the API will reject a new avatar upload via the endpoint to avoid unintended overrides.
The uploaded image will be saved to:
Configuration
Add one or more API keys to your config:
And in your .env file:
đ ī¸ Installation
You can install the package via composer:
âī¸ Configuration
You can also publish specifically:
Testing
To keep the package flexible and testable, the AvatarManager uses an interface for accessing user data:
Mapo89\LaravelAvatarManager\Contracts\UserProviderInterface
For tests, the test user class is bound via TestUserProvider.
Production operation
In the service provider, the package binds the real user class (e.g. App\Models\User) by default:
The UserProvider class implements the logic to find users via email hash.
Execute tests
The tests can be executed with various commands:
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
- Manuel Postler
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.