Weave Code
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 Laravel Package

codebyray/livewire-media-uploader

View on GitHub
Deep Wiki
Context7
v0.6.0

Added

  • Drag-and-drop media ordering. Added native HTML5 drag-and-drop reordering to both Tailwind and Bootstrap themes for attached media and the pending upload queue.
    • Supports inserting items before or after the current target, including moving items to the end of the list.
    • Displays a visual drop-position indicator while dragging.
    • Persists attached-media ordering using Spatie Media Library's order_column.
    • Supports reordering pending uploads before they are saved.
    • Keeps list-all ordering scoped to the individual media collection.
    • Dispatches a media-reordered event after persisted media is reordered.
    • Uses the existing Alpine.js integration with no additional JavaScript dependency.
  • Clickable thumbnail previews. Image thumbnails for pending uploads and attached media can now be clicked to open the existing preview overlay.

Changed

  • Updated documentation to clarify that multiple controls file selection but does not override Spatie Media Library's singleFile() collection behavior.
  • Updated image conversion examples to use Spatie\Image\Enums\Fit for compatibility with current Spatie Image releases.
v0.5.0

Added

  • Optional authorization hook (authorizeAbility): Pass a Gate/Policy ability name and the component will call Gate::authorize() against the resolved target model before uploadFiles, remove, saveEdit, and the media:attach handler run. Unset by default — fully backward-compatible, opt-in only. See README Authorization section.
  • CI: GitHub Actions workflow testing the PHP × Laravel × Livewire support matrix on every push/PR.

Changed

  • Dropped Laravel 10 and 11 support. Both are past their security-support window (Laravel 10 EOL; Laravel 11 security support ended March 2026) and current releases in both lines carry unpatched advisories that block a fresh composer install under Composer's default audit policy — confirmed via CI, not a judgment call. If you're on Laravel 10/11, stay on v0.4.x and prioritize a Laravel upgrade.
  • Raised minimum PHP to 8.2 to match what's actually installable with supported Laravel/Spatie Media Library versions.
  • Widened pestphp/pest and pestphp/pest-plugin-laravel dev constraints to also allow ^4.0, which is what unlocks Laravel 13 test coverage (pest-plugin-laravel didn't support Laravel 13 until its v4.1.0 release).

Fixed

  • Corrected README/composer.json copy that said "Livewire v3" despite ^3.0 || ^4.0 already being the supported range.

v0.4.0

Added

  • NameConflictStrategy Enum: Introduced a strongly-typed Enum for handling name conflicts (RENAME, REPLACE, SKIP, ALLOW), replacing raw string checks.
  • Custom ModelResolutionException: Replaced generic abort() calls with a dedicated exception for clearer debugging when model binding fails.

Changed

  • Configurable Namespaces: The component now resolves models using the model_namespaces configuration array instead of hardcoded App\Models strings, allowing for better support in modular/domain-driven architectures.
  • Validation Refactor: Centralized upload validation into a dedicated rules() method, simplifying the uploadFiles() logic and improving maintainability.

Fixed

  • Improved exception handling in test suite to correctly capture and assert custom package exceptions.
  • Resolved potential MassAssignmentException issues in tests when instantiating standard User models.
v0.3.0

Added

  • Deferred uploads on create: You can now queue files before the target model exists and attach them after save by dispatching the media:attach event. The uploader accepts model="post" (no id) on create screens, holds the queue + per-file meta, and attaches once you dispatch. Emits media-attached when done.
  • list-all view: Set :list-all="true" to show all collections for the current model in a single list, grouped by collection name. Items remain fully editable (caption/description/order).
  • Tailwind dark mode docs/snippets: Added guidance and examples for enabling global light/dark mode with the Tailwind theme.

Changed

  • Graceful “no target yet” behavior on create screens:
    • nextOrder() now derives order from the local queue if the model isn’t saved yet.
    • uploadFiles() queues when there’s no target (instead of erroring) and flashes: “Files queued. They will be attached after you save.”

Fixed

  • N/A

v0.2.0

Added

  • Theme system with Tailwind (default) and Bootstrap themes.
  • Custom themes support:
    1. Create a new folder under resources/views/vendor/media-uploader/themes, e.g. custom/.
    2. Copy media-uploader.blade.php from tailwind/ or bootstrap/ into custom/ (keep the filename).
    3. Register in config:
      'themes' => [
          'tailwind'  => 'media-uploader::themes.tailwind.media-uploader',
          'bootstrap' => 'media-uploader::themes.bootstrap.media-uploader',
          'custom'    => 'media-uploader::themes.custom.media-uploader',
      ],
      'theme' => 'custom', // to make it default
      
    4. Or set per-instance:
      <livewire:media-uploader :for="$post" collection="images" theme="custom" />
      
  • Configuration docs for each option in config/media-uploader.php, including ENV overrides, presets (types, mimes, max_kb), and collection → preset mapping.

Changed

  • Default view now resolves via the theme map (Tailwind by default).
    Existing installs continue to render with Tailwind unless you switch themes.

Compatibility

  • No breaking changes. Defaults preserve prior behavior.
  • If you previously published the old (pre-theme) Blade, it will keep working if you’ve retained the legacy alias. If you want to use the new theme system, publish/move your override to themes/<your-theme>/media-uploader.blade.php.

Migration Notes (only if you customized the old path)

  • Minor migration required for users who published the old view (move file to the themed path).
  • Move your customized Blade from:
    resources/views/vendor/media-uploader/livewire/media-uploader.blade.php
    
    to:
    resources/views/vendor/media-uploader/themes/tailwind/media-uploader.blade.php
    
    (or into your custom theme folder), and register that theme in the config.
v0.1.0

Added

  • Livewire v3 media uploader component.
  • Tailwind-only publishable Blade view with Alpine-powered image preview overlay and delete confirmation modal.
  • Spatie Laravel Media Library integration:
    • Attach/list/delete media within a configurable collection (e.g., images, avatars, photos).
    • Per-file metadata (caption, description, order).
    • Optional thumbnail usage (getUrl('thumb')) with graceful fallback.
  • Drag & drop uploads with progress indicator.
  • Validation presets via config (types, mimes, max size) with collection→preset mapping and optional auto-accept attribute.
  • Name-conflict strategies: rename, replace, skip, allow.
  • Exact duplicate detection (SHA-256) with skipExactDuplicates.
  • Flexible model resolution:
    • :for="$model" (saved instance),
    • model="user" :id="1" (short name + id),
    • FQCN, morph map alias, or dotted paths with custom namespaces and local aliases.
  • Events for UX integrations:
    • media-uploaded, media-deleted (with id), media-meta-updated.
  • Publishable config (media-uploader.php) and view (livewire/media-uploader.blade.php).
  • Test suite (Pest + Testbench) with in-memory SQLite and fake disks.

Upgrade
  • To get thumbnail previews, add a thumb conversion on your model or adjust the view to your conversion names.
  • For single-file collections (e.g., avatars), declare the collection in your model and call ->singleFile(); the component’s multiple=false only affects the input, not backend replacement.

Deprecations
  • Any deprecations will be noted here and kept for at least one subsequent minor (e.g., deprecate in 0.3.x, remove in 0.4.0). After 1.0.0, deprecations will be removed in the next major release.

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.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle