Looking to hire Laravel developers? Try LaraJobs

laravel-mediaman maintained by emaia

Description
MediaMan - Elegant & powerful media management package for Laravel!
Author
Last update
2026/08/19 23:01 (dev-main)
License
Downloads
82

Comments
comments powered by Disqus

Latest Version on Packagist GitHub Tests Action Status Coverage Total Downloads

Laravel MediaMan

MediaMan is an elegant and powerful media management package for Laravel apps with a painless uploader, virtual collections, automatic conversions and responsive images, and per-model channel associations.

The API is fluent and UI-agnostic — you stay in control of how things look and behave. Equally, at home in a web app or an API server.

Quick example

$media = MediaUploader::fromRequest('featured_image')
    ->useCollection('Posts')
    ->upload();

$post = Post::find(1);
$post->attachMedia($media, 'featured-image-channel');

Core concepts

  • Uploader — fluent entry point. Uploads exist independently of any model.
  • Media — any uploaded file, persisted as its own record. Validate types/sizes in your form requests.
  • Collections — a virtual group of media; many-to-many with Media. Great for asset libraries.
  • Channels — per-model tags (avatar, gallery, …) stored in the polymorphic mediaman_mediables pivot. They also drive conversions.
  • Conversions — transformations registered globally (resize, watermark, format change) and run when media is attached to a channel.
  • Responsive Images — multi-size, multi-format variants (AVIF/HEIC/WebP/JPG/PNG) with ready-made <picture>/srcset HTML.

Documentation

Installation Requirements, composer, publishing assets, upgrade paths
Configuration Disk, queue, image driver, validation, security, MediaResolver, per-variant disk, responsive images, placeholder
Media The Media entity: retrieve, update, delete, HTTP responses, mail, copy/attachTo
Collections MediaCollection: CRUD, validation, auto-prune
Models & Channels HasMedia trait: attach, sync, retrieve, order; channel fallbacks, conversions, validation rules
Conversions Global registration, per-channel execution, per-conversion disk, format detection, failure isolation
Responsive images Generation, per-format quality, HEIC/AVIF/WebP support, <picture> / srcset, width calculators
Uploads MediaUploader: source, fromRequest, fromDisk, fromBase64, fromUrl, fromStream, fromString
Security SVG sanitizer, disallowed extensions, file-size bounds, SSRF guard, orphan cleanup
Events The six package events
Artisan commands Doctor health check, publish assets, orphan cleanup, conversion/responsive generation and stats
Recipes PDF/video thumbnails, image optimization, ZIP downloads, multi-file uploads, partial attach
API reference Public surface by class/trait

Release history: CHANGELOG.md. Upgrade notes: UPGRADING.md.

Requirements

Laravel Package PHP
v12–v13 2.x–3.x 8.3+

Quick install

composer require emaia/laravel-mediaman
php artisan mediaman:publish
php artisan storage:link
php artisan migrate
php artisan mediaman:doctor

See Installation for the full setup, including the upgrade path for existing installations.

Contribution and license

Found a bug? Open an issue. Feature requests & PRs are welcome.

The MIT License (MIT). Please read the License File for more information.