Avatars

StyleCI Codacy Badge License Total Downloads Latest Stable Version

User Avatar manager dependency for Laravel Enso.

This package works exclusively within the Enso ecosystem.

The front end assets that utilize this api are present in the ui package.

For live examples and demos, you may visit laravel-enso.com

Watch the demo click on the photo to view a short demo in compatible browsers

Installation

Comes pre-installed in Enso.

Features

  • comes with a table migration, in order to be able to store avatar related data
  • includes model, routes & controllers
  • creates a folder used to store the avatar files and a default avatar for users that do not have an avatar set
  • uses the File Manager package for uploading the avatar files
  • uses the Image Transformer package for cropping and optimizing the avatar files
  • uses the Laravolt Avatar for generating avatars from user names
  • uses a policy to ensure that normal users can only modify their own avatars, while administrators can modify any avatar

Notes on usage

Since this package is using image processing libraries and these underlying libraries may use a lot of memory, especially if the processed files are large (for example, for an 8MB image file, more than 128MB of memory might be used ), make sure to configure php accordingly and/or do ini_set(‘memory_limit’, ‘256M’);

Failure to do so may result in silent errors if allotted memory is insufficient.

Commands

  • php artisan enso:avatars:generate - generates avatars for users which do not already have an avatar

Publishes

  • php artisan vendor:publish --tag=avatars-storage - storage folder and default avatar

External dependencies

Contributions

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

License

This package is released under the MIT license.