plank/laravel-mediable
Laravel-Mediable lets you easily upload files and attach them to Eloquent models via many-to-many polymorphic relationships, with tags for organizing media, configurable filesystem destinations, MIME/extension restrictions, and image variant support.
image_url columns to every table?" fork and keeps the media concern orthogonal to domain tables. Worth approving early because retrofitting it later is a migration project.moveToDisk()/copyToDisk(), with S3 temporary URL support for private assets. This is a decision-enabler for the "when do we invest in cloud storage / signed URL delivery?" question.alt attribute on Media records with withAltAttribute(). If accessibility (WCAG/ADA) is on the compliance roadmap, this converts "we'll retrofit alt text later" into a schema-level commitment now — a cheap, high-leverage yes.intervention/image integration with synchronous or queued variant generation, plus optional optimization via spatie/image-optimizer. This supports the decision on whether thumbnails are generated at upload time (better UX, more storage/CPU) or on demand, and whether image optimization is in scope or deferred.image), content-inferred MIME by default (v6 flipped the default away from client-supplied MIME), validateHash() for integrity checking, and filename sanitization/transliteration. These are the controls you need to answer a security review question before launch rather than after an incident.Good fit:
intervention/image v3 as a peer dependency.Look elsewhere when:
image_path column and Laravel's native Storage facade is less machinery than a migrations + service provider + polymorphic pivot install.?w=300&fit=crop), global CDN edge delivery, or responsive srcset generation at the edge — this package generates variants server-side and stores them.For executives — the one-paragraph version:
For our Laravel application, plank/laravel-mediable is an 828-star, MIT-licensed, actively maintained package that gives us file uploads, attachment-to-any-record, tagged media roles, automatic image resizing, and private cloud-storage delivery out of the box. Adopting it converts several recurring roadmap features — galleries, thumbnails, document attachments, user avatars — from bespoke engineering projects into configuration. Because it is MIT and free, our spend is measured in integration days, not licence fees; and because it is a library rather than a platform, we keep the option to swap in a hosted media service later if we ever need video, CDN transforms, or a full asset-management UI. The main trade-off to accept is that it is community-maintained with no commercial SLA, so we own upgrades — most recently a breaking v6 release that requires PHP 8.1+ and Laravel 10/11.
For engineering — what you're actually signing up for:
media table plus polymorphic pivot.MediaUploader supporting local files, remote URLs, streams, and data URLs.intervention/image v3 for manipulation and optionally spatie/image-optimizer for compression.getContents()/path()/valid(), content-derived MIME by default). Budget migration time if we are on v5.How can I help you explore Laravel packages today?