emaia/laravel-mediaman
Laravel MediaMan is a UI-agnostic media manager for Laravel. Upload files via a fluent MediaUploader, organize them into virtual collections, attach media to any model through polymorphic associations, tag by channels, and run automatic image conversions.
Feature Development:
maxFileSize() and config, reducing storage costs and mitigating abuse (e.g., spam uploads or DoS via large files). Integrate with frontend validation (e.g., Dropzone.js) for seamless UX.syncMedia() operations (e.g., for e-commerce bulk imports) with bulk attach, reducing database I/O from N inserts to 1—critical for high-volume migrations or API-driven workflows.findByName() methods for predictable, lazy-loaded media queries (e.g., fetching "hero-banner.jpg" from a MediaCollection), simplifying frontend API design.calculateWidthsFromBinary() for advanced use cases (e.g., dynamic aspect-ratio adjustments based on file metadata or AI analysis).Roadmap Priorities:
findByName()) and validate bulk sync performance in production (e.g., migrate 10K+ legacy media attachments).FileSizeExceeded exception handling for consistent error responses.WidthCalculator implementations (e.g., for adaptive bitrate streaming or format-specific optimizations).Build vs. Buy:
Use Cases:
Adopt This Package When:
findByName() methods (e.g., for frontend caching or CDN invalidation).findByName()) in exchange for performance gains.FileSizeExceeded exception support) and have queue workers for async processing.Look Elsewhere When:
MediaCollection::with('media')->findByName()) → Refactor or use lazy-loading."MediaMan v2.1.0 supercharges our media infrastructure with governance, performance, and scalability—here’s the impact:
findByName() methods simplify API design for frontends, reducing complexity in our [Headless CMS] roadmap.Use Case: Imagine our marketplace loading product images 30% faster while blocking malicious 1GB uploads—all with zero dev overhead. This supports [Tech Stack Modernization] and [Security Hardening] goals."*
"MediaMan v2.1.0 delivers critical fixes, performance wins, and new governance tools—here’s how to leverage it:
File Size Governance:
MediaUploader::maxFileSize(10485760) (10MB) or .env (MEDIAMAN_MAX_FILE_SIZE=10485760).FileSizeExceeded exceptions globally (e.g., return 413 Payload Too Large to APIs).maxFilesize for seamless UX.Bulk Media Sync:
syncMedia() loops with bulk attach: Model::syncMedia($mediaIds) → 1 DB insert instead of N.Responsive Images:
sys_get_temp_dir usage post-upgrade (should be zero).API Improvements:
findByName() methods (e.g., Media::findByName('hero.jpg')) for predictable, lazy-loaded queries.MediaCollection::findByName('x') instead of with('media')->findByName()).Custom Width Calculators:
WidthCalculator with calculateWidthsFromBinary() for advanced logic (e.g., metadata-based resizing).Migration Path:
findByName() in staging (focus on high-volume endpoints).Alternatives Considered:
Next Steps:
How can I help you explore Laravel packages today?