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
Livewire Media Uploader

Livewire Media Uploader Laravel Package

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.

View on GitHub
Deep Wiki
Context7

A reusable Livewire v3/v4 component for Spatie Laravel Media Library with a clean, publishable Tailwind Blade view (Bootstrap theme optional). Drag-and-drop uploads, Alpine overlays, inline metadata editing, and configurable presets get you shipping in minutes.

  • Per-file metadata: edit caption, description, and order, plus drag-to-reorder attached media
  • Name-conflict strategies: rename, replace, skip, or allow, with optional SHA-256 duplicate detection
  • Themeable UI: publishable Tailwind default, Bootstrap option, or fully custom views
  • Authorization hook: delegates to your app's Gate/Policy via authorizeAbility
  • Collection presets: automatic accept attributes mapped per collection
Frequently asked questions about Livewire Media Uploader
How do I install codebyray/livewire-media-uploader in a Laravel app?
Install it with Composer using composer require codebyray/livewire-media-uploader; service provider auto-discovery handles registration. You can optionally publish the config and Blade views, then render the Livewire component with a model and collection. Confirm your app meets PHP 8.2+, Laravel ^12 or ^13, Livewire ^3 or ^4, and Spatie Media Library ^10.12 or ^11.
Does Livewire Media Uploader support Laravel 12 and Livewire v4?
Yes. The package requires PHP 8.2+, Laravel ^12 or ^13, Livewire ^3 or ^4, and Spatie Laravel Media Library ^10.12 or ^11. Laravel 10 and 11 support was deliberately dropped at v0.5.0 with a security rationale, so legacy apps must upgrade first.
How do I use the media uploader with an unsaved model or create form?
The README documents a create flow for deferred uploads, so the component can work with saved or unsaved models. It supports model resolution via saved instances, string model plus id, FQCN, morph alias, dotted namespace paths, and per-instance aliases. Because the component owns queued files, conflict strategy, metadata, and reorder state, embedding it inside larger forms means understanding its event contract rather than treating it as a plain input.
How do I configure authorization for uploads and deletes?
Authorization is opt-in through the authorizeAbility hook, which delegates checks to your own Gate or Policy. If you leave it unset, any user who can render the component can act on the collection, so configure it for production screens. The package intentionally does not ship an auth package dependency.
What are the file name conflict strategies and duplicate detection options?
Name conflicts can be handled with rename, replace, skip, or allow strategies. Optional SHA-256 duplicate detection blocks exact re-uploads, but hashing happens per file and can add CPU and IO cost on the request path for large video presets. Enable duplicate detection only where the tradeoff makes sense.
Can I customize the Tailwind or Bootstrap theme views?
Yes. It ships a publishable Tailwind Blade view by default and includes an optional Bootstrap theme that needs Bootstrap CSS but explicitly not Bootstrap JS. You can also map a custom theme. Once you publish and customize views, upstream theme fixes no longer reach you silently, so plan to track changes.
How do I map collections to file presets and accept attributes?
The component supports collection-to-preset mapping, which automatically sets the accept attribute for uploads. Presets and collection behavior are configured through the package configuration and published assets. Point the component at a model and collection, then define presets that match your expected file types.
Is this package production-ready and well maintained?
Treat it as early-stage: it is 0.x, has seven stars, zero dependents, and a single maintainer handle. That means limited third-party battle-testing and no community fallback if maintenance stops. The MIT license lets you fork, but you need operational capacity to own it, so pin exact versions and assess bus factor before production adoption.
What tests and CI matrix does the package run?
The README claims every PHP, Laravel, and Livewire combination is verified on every push via GitHub Actions. Before adopting, confirm the matrix breadth and whether tests cover uploads, conflict strategies, and deferred attach paths rather than only rendering. Ask the maintainer for coverage details if those paths are critical to your app.
What alternatives or integration risks should I consider before adopting it?
If you already use Spatie Laravel Media Library, this package is an additive Livewire wrapper rather than a new persistence or storage layer, which lowers architectural risk. Alternatives include building a custom Livewire uploader or evaluating other media upload packages against your Laravel and Livewire versions. Main risks are supply chain and longevity, pre-1.0 API churn, published view drift, opt-in authorization, Alpine and Tailwind coupling, and the hard Laravel 12+ gate for legacy estates.
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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core