emaia/laravel-mediaman

MediaMan - Elegant & powerful media management package for Laravel!

Maintainers

Package info

github.com/emaia/laravel-mediaman

pkg:composer/emaia/laravel-mediaman

Statistics

Installs: 67

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v3.0.0 2026-06-25 23:01 UTC

README

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

  • Media — any uploaded file, persisted as its own record. Validate types/sizes in your form requests.
  • MediaUploader — fluent entry point. Uploads exist independently of any model.
  • MediaCollection — a virtual group of media; many-to-many with Media. Great for asset libraries.
  • Channel — a per-model tag (avatar, gallery, …) stored in the polymorphic mediaman_mediables pivot. Channels also drive conversions.
  • Conversion — a transformation 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
Uploads MediaUploader: source, fromRequest, fromDisk, fromBase64, fromUrl, fromStream, fromString
Models & associations HasMedia trait, channels, channel-level validation rules, ordering, fallbacks
Collections MediaCollection: CRUD, validation, auto-prune
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
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

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.