emaia/laravel-mediaman
Composer 安装命令:
composer require emaia/laravel-mediaman
包简介
MediaMan - Elegant & powerful media management package for Laravel!
关键字:
README 文档
README
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 polymorphicmediaman_mediablespivot. 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>/srcsetHTML.
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
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.
emaia/laravel-mediaman 适用场景与选型建议
emaia/laravel-mediaman 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 67 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 04 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel package」 「laravel file manager」 「laravel media」 「laravel mediaman」 「laravel media collection」 「laravel media management」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 emaia/laravel-mediaman 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 emaia/laravel-mediaman 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 emaia/laravel-mediaman 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox
Laravel Media Popup to upload/view the files
PMVC Plugin for File information
Mapper for accessing resources in KWCMS
Simple ASCII output of array data
统计信息
- 总下载量: 67
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-30