Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Media

Laravel Media Laravel Package

elegantly/laravel-media

A media library for Laravel that handles file uploads, image conversions, and storage across disks. Attach media to Eloquent models, generate responsive images, and manage assets with a clean, fluent API. Ideal for apps needing flexible, organized media management without extra boilerplate.

View on GitHub
Deep Wiki
Context7

elegantly/laravel-media is a Laravel package for managing media files and attaching them to your application’s Eloquent models. It provides a clean, Laravel-friendly way to organize uploads, store files on configured disks, and retrieve media when needed.

  • Attach media to Eloquent models with minimal setup
  • Store files using Laravel’s filesystem disks
  • Organize uploads into media collections
  • Generate URLs and access stored media easily
  • Keep media handling simple and maintainable
Frequently asked questions about Laravel Media
How do I install elegantly/laravel-media?
Install it with composer require elegantly/laravel-media, then publish the package config and migrations and run php artisan migrate. Add the package's media trait to any Eloquent model that should own uploads. The package owns its own media table, so existing tables only need polymorphic keys rather than schema changes.
Can I attach multiple media files and named collections to an Eloquent model?
Yes. You can define named media collections and attach either a single file or multiple files to an Eloquent model through a fluent API. Because the relation is polymorphic, the same trait can be applied to several models in one application.
Which Laravel and PHP versions does elegantly/laravel-media support?
The authoritative answer is the illuminate/* and PHP constraints in the package's composer.json. It is a conventional Laravel package built around Eloquent and filesystem disks, but Laravel 10, 11, and 12 compatibility should be verified against your lockfile before adoption. Also check whether image conversion pulls Intervention Image v2 or v3, since that is a common Composer resolution conflict.
How does elegantly/laravel-media compare to spatie/laravel-medialibrary?
It is a direct functional substitute for spatie/laravel-medialibrary: the same problem of attaching many files to many models, generating conversions, and managing disks. The feature surface is comparable, but the ecosystem exposure is far smaller, with few stars and no public dependents. Choose it when the fluent API and configuration fit your needs; choose Spatie when you need a large production base and third-party examples.
Does elegantly/laravel-media support image conversions and nested conversions?
Yes. The package supports image conversions and advanced nested media conversions, allowing derived renditions from stored media. Conversion definitions are registered through configuration, and you should confirm whether conversions run synchronously or are queued in your setup. Nested conversions are useful for responsive variants, but validate the generated paths and disk usage.
Can I store media on S3, GCS, or a local disk?
Yes. elegantly/laravel-media is built on Laravel's filesystem abstraction and supports diverse disks, including local, S3, and GCS-style storage. You configure the default disk and per-collection disk mappings in the published config. Path generation is customizable, so review the defaults for public versus private visibility.
How does the package handle metadata extraction and custom properties?
The package performs rich metadata extraction and lets you store custom properties alongside each media item. Metadata such as dimensions, MIME type, and size can be read from the media model, while custom properties cover application-specific fields. Treat extracted EXIF and SVG metadata as untrusted input when rendering.
Is elegantly/laravel-media production-ready, and what upload security should I audit?
Treat that as an audit item rather than an assumption. With roughly 49 stars and no observable dependents, you would be an early production canary, so review the test suite, CI matrix, and maintainer history. Specifically audit MIME and extension validation, size limits, SVG handling, default disk visibility, and whether conversions are queued. Pin the version and wrap the package behind your own service boundary if media is load-bearing.
How should I test media uploads and conversions in my Laravel test suite?
Use Laravel's Storage::fake() for the configured disk and assert that media records and files are created through your upload endpoints. Test single and multiple collection uploads, conversion generation, and authorization policies around attaching or deleting media. If conversions are queued, use Queue::fake() or run the queue worker in the test to verify derived files.
Does it clean up files when a model is deleted, and is there a prune command?
The package manages original files and derived renditions, but you should verify delete and soft-delete cleanup behavior in your version before relying on it. Check whether deleting a model removes its media records and disk files, and whether a prune command exists for orphaned files. If not, add a scheduled cleanup job and test it against your storage disk.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections