codebyray/livewire-media-uploader
A reusable Livewire v3/v4 component for Spatie Media Library with publishable Tailwind or Bootstrap views, drag-and-drop uploads, inline caption/description/order editing, reordering, conflict strategies, SHA-256 duplicate detection, and optional authorization hooks.
This release strengthens deferred attachment security and fixes media replacement, ownership checks, queue ordering, and uploaded display names.
authorizeAbility and a successful Gate/Policy check against the saved target.Deferred uploaders must now set authorizeAbility and provide a matching Gate/Policy:
<livewire:media-uploader
model="post"
collection="images"
authorizeAbility="update"
channel="post-images"
/>
Configure collection and disk on the uploader rather than overriding them through attach events. A mismatched collection is ignored; a mismatched disk or an attempt to switch the bound target returns 403.
Uploaders already bound to a saved record may continue relying on application authorization of that fixed target.
Dependency requirements are unchanged. No package database migration or new configuration key is required.
See the [upgrade guide](https://github.com/codebyray/livewire-media-uploader/blob/v0.8.0/README.md#upgrading-to-v080) for a policy example and matching attach event.
Expanded regression coverage to 51 passing tests with 151 assertions, verified on Laravel 12/Livewire 3 and Laravel 13/Livewire 4, including rendering checks for both supplied themes.
[Full changelog](https://github.com/codebyray/livewire-media-uploader/compare/v0.7.0...v0.8.0)
This release adds drag-and-drop media ordering to Livewire Media Uploader, along with improved image preview interactions and updated documentation for current Spatie Media Library usage.
Media can now be reordered directly from the uploader using native drag-and-drop.
order_column.list-all mode keeps ordering scoped to each individual media collection.A new media-reordered event is dispatched after persisted media has been reordered.
Image thumbnails can now be clicked to open the existing image preview overlay.
This works for both:
The filename and thumbnail now provide the same convenient preview behavior.
singleFile() collection configuration.Spatie\Image\Enums\Fit for compatibility with current Spatie Image releases.No breaking changes are expected when upgrading from v0.5.x.
composer require codebyray/livewire-media-uploader:^0.6
Existing uploader implementations should continue to work without modification. Drag-and-drop ordering and the improved preview interactions are available automatically when using the updated package views.
This release intentionally drops Laravel 10 and 11 support and raises the PHP floor to 8.2.
Both Laravel majors are past their security-support window (Laravel 10 is fully EOL; Laravel 11's security support ended March 2026), and current releases in both lines carry unpatched CVEs — meaning a fresh composer install against either is now blocked outright by Composer's own security-advisory audit for most consumers. This isn't a preference change; it's the ecosystem itself telling us those versions shouldn't be recommended for new installs anymore.
If you're on Laravel 10/11: stay on v0.4.x and prioritize upgrading Laravel — that's the more urgent fix regardless of this package.
Now supported: Laravel ^12.0 | ^13.0, PHP ^8.2, Livewire ^3.0 | ^4.0 — every combination verified via CI on every push.
authorizeAbility prop. Set it to a Gate/Policy ability name and the component will call Gate::authorize() against the target model before any mutating action (uploadFiles, remove, saveEdit, and the media:attach handler). Left unset, behavior is unchanged from prior versions — this is opt-in and fully backward-compatible. See the Authorization section in the README.composer.json said "Livewire v3" despite ^3.0 || ^4.0 already being supported.No code changes required if you're already on Laravel 12/13 + PHP 8.2+. If you're on Laravel 10/11 or PHP 8.1, hold on v0.4.x until you've upgraded your app.
Full Changelog: https://github.com/codebyray/livewire-media-uploader/compare/v0.4.0...v0.5.0
This release focuses on architectural stability, introducing strict typing for name conflicts, better error handling, and more flexible model resolution.
Full Changelog: https://github.com/codebyray/livewire-media-uploader/compare/v0.3.2...v0.4.0
Full Changelog: https://github.com/codebyray/livewire-media-uploader/compare/v0.3.1...v0.3.2
spatie/laravel-medialibrary → ^10.12 || ^11.0.composer require codebyray/livewire-media-uploader:^0.3 -W
listAll view by @codebyray in https://github.com/codebyray/livewire-media-uploader/pull/3Full Changelog: https://github.com/codebyray/livewire-media-uploader/compare/v0.2.0...v0.3.0
Full Changelog: https://github.com/codebyray/livewire-media-uploader/compare/v0.1.0...v0.2.0
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Versioning policy: Until
1.0.0, minor bumps (e.g.,0.1 → 0.2) may include breaking changes. Patch releases in the same minor (e.g.,0.1.x) are bug fixes only.
MEDIA_TYPES_*, MEDIA_MIMES_*, MEDIA_MAXKB_*).TestableMediaUploader) and event-based assertions.media table migration loads under Testbench and configured fake disks (public, local, tmp-for-tests).images, avatars, photos).getUrl('thumb')) with graceful fallback.accept attribute.rename, replace, skip, allow.skipExactDuplicates.:for="$model" (saved instance),model="user" :id="1" (short name + id),media-uploaded, media-deleted (with id), media-meta-updated.media-uploader.php) and view (livewire/media-uploader.blade.php).0.3.x, remove in 0.4.0). After 1.0.0, deprecations will be removed in the next major release.thumb conversion on your model or adjust the view to your conversion names.avatars), declare the collection in your model and call ->singleFile(); the component’s multiple=false only affects the input, not backend replacement.How can I help you explore Laravel packages today?