A lightweight, WordPress-style media selector for Laravel applications powered by Livewire.
Full documentation: livewire-media.thejano.com
- Browse, search, and paginate media stored on your Laravel disks
- Upload new files (respecting size, extension, and mime limits)
- Single or multiple selection with drag-to-reorder support
- Optional collections to group media per feature (e.g.
gallery,avatars) - Trait helpers (
attachMedia,syncMedia,getMediaUrl) for quick model integration - Soft delete, restore, and optional trash tab when you need moderation
- Emits Livewire/browser events so you can react to uploads, deletes, and selections
- Action buttons are hidden by default and appear on hover (non-interactive when hidden)
- Clear, thicker selection ring with offset for better contrast
- Select File tab is the default when the modal opens
- New
can_uploadconfig and:canUploadattribute to disable Upload tab and uploads - RTL support (auto when locale is Arabic/Kurdish/etc.); key positions flip in RTL
- Translations included (English, Arabic, Kurdish/Sorani) with publishable lang files
- Component inherits your app’s font-family
- PHP >= 8.1
- Laravel 10–12
- Livewire 3.3+
Note: Livewire 3 requires Laravel 10+. If you need Laravel 9 support, a Livewire v2–compatible variant is required (not included in this package version).
Require the package:
composer require drpshtiwan/livewire-media-selectorPublish the config (optional):
php artisan vendor:publish --tag=media-selector-configPublish the migration and run it:
php artisan vendor:publish --tag=media-selector-migrations
php artisan migrateEnsure your public disk is set up and linked:
php artisan storage:linkPublish the views (optional, if you want to customize the markup/classes):
php artisan vendor:publish --tag=media-selector-viewsPublish the assets (CSS):
php artisan vendor:publish --tag=media-selector-assets --forceSimple usage:
<livewire:media-selector wire:model="media" collection="gallery" />Read the docs for setup details, configuration options, and integration patterns.
Developed and maintained by drpshtiwan.
MIT License. See LICENSE for details.