PHPackages                             drpshtiwan/livewire-media-selector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. drpshtiwan/livewire-media-selector

ActiveLibrary[Image &amp; Media](/categories/media)

drpshtiwan/livewire-media-selector
==================================

A Livewire-powered media selector for Laravel, similar to WordPress media library.

4.0.0(4w ago)19180MITJavaScriptPHP ^8.3CI passing

Since Oct 31Pushed 4w agoCompare

[ Source](https://github.com/drpshtiwan/livewire-media-selector)[ Packagist](https://packagist.org/packages/drpshtiwan/livewire-media-selector)[ Docs](https://github.com/drpshtiwan/livewire-media-selector)[ RSS](/packages/drpshtiwan-livewire-media-selector/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (14)Versions (6)Used By (0)

Livewire Media Selector
=======================

[](#livewire-media-selector)

[![Packagist Version](https://camo.githubusercontent.com/7cc3c601d693e9457f44c0f42931d2fd576c1a0b440ebc999851dddd2a454bf6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6472707368746977616e2f6c697665776972652d6d656469612d73656c6563746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drpshtiwan/livewire-media-selector)[![Total Downloads](https://camo.githubusercontent.com/9377dd95360a4d02a92193c5c20b51e46bd6c0b6c4d53371909b20920e5ac55b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6472707368746977616e2f6c697665776972652d6d656469612d73656c6563746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drpshtiwan/livewire-media-selector)[![License](https://camo.githubusercontent.com/cabe8c17d1677a4c4b7a4321f91367677ca487f4d43cdd6876976f6f502d13f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6472707368746977616e2f6c697665776972652d6d656469612d73656c6563746f722e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Tests](https://camo.githubusercontent.com/ef2042b08482e4137db34f9fa36ffb97d0a57d172917c06bae4fb9e4231f8d82/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6472707368746977616e2f6c697665776972652d6d656469612d73656c6563746f722f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/drpshtiwan/livewire-media-selector/actions)[![Code Style: Laravel Pint](https://camo.githubusercontent.com/0755e671aaf0bcab69aebf6103fd3ce79f275cf14ed7bb2736a4fba67441308a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d4c61726176656c25323050696e742d4646324432303f7374796c653d666c61742d737175617265)](https://github.com/laravel/pint)[![PHP Version](https://camo.githubusercontent.com/0b165644537123f679e513228ce17962804ffe3b8be447a4183a1bc28a7a227b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6472707368746977616e2f6c697665776972652d6d656469612d73656c6563746f723f7374796c653d666c61742d737175617265)](composer.json)

A lightweight, WordPress-style media selector for Laravel applications powered by Livewire.
Full documentation: [livewire-media.thejano.com](http://livewire-media.thejano.com/)

Screenshots
-----------

[](#screenshots)

[![Media selector preview](assets/image.png)](assets/image.png)

### Video demo

[](#video-demo)

[![Watch the demo on YouTube](https://camo.githubusercontent.com/4fcbcbd0112b073385a1e894a7149fda004ab6882be03545268dd3f89d5f0cbe/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f34536e6a6b323231336c732f687164656661756c742e6a7067)](https://www.youtube.com/watch?v=4Snjk2213ls)

### Features

[](#features)

- 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

#### UX &amp; i18n updates

[](#ux--i18n-updates)

- 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_upload` config and `:canUpload` attribute 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

Installation
------------

[](#installation)

### Requirements

[](#requirements)

- PHP &gt;= 8.3
- Laravel 12–13
- Livewire 3.5+ or 4.x

Note: Laravel 11 and earlier are not supported — Laravel 11 reached its security-fix end-of-life in March 2026. For older Laravel versions, use the `1.x` line of this package.

Require the package:

```
composer require drpshtiwan/livewire-media-selector
```

Publish the config (optional):

```
php artisan vendor:publish --tag=media-selector-config
```

Publish the migration and run it:

```
php artisan vendor:publish --tag=media-selector-migrations
php artisan migrate
```

Ensure your `public` disk is set up and linked:

```
php artisan storage:link
```

Publish the views (optional, if you want to customize the markup/classes):

```
php artisan vendor:publish --tag=media-selector-views
```

Publish the assets (CSS):

```
php artisan vendor:publish --tag=media-selector-assets --force
```

Simple usage:

```

```

[Read the docs](http://livewire-media.thejano.com/) for setup details, configuration options, and integration patterns.

Security
--------

[](#security)

The selector enforces a clear trust boundary between what the **server** controls and what the **browser** may change:

- **Permission and config are server-only.** Flags such as `canDelete`, `canUpload`, `canSeeTrash`, `canRestoreTrash`, `restrictToCurrentUser`, the allowed file types (`mimes`/`extensions`), the storage `disk`/`directory`, and upload limits are `#[Locked]` Livewire properties. They are resolved once in `mount()` from the attributes you pass and from config; a crafted Livewire request **cannot** flip a permission, widen the allowed file types to smuggle an executable upload, or repoint the storage location.
- **Derive permissions from your own authorization.** Pass the flags from policies/gates, e.g. `:can-delete="auth()->user()?->can('delete', $model)"`. The package will not grant an action you did not enable.
- **Selections and deletions are re-validated server-side** against the active, scoped query — a user can never select, insert, or delete media outside the disk/collection/owner scope they are viewing.
- **SVG uploads are disabled by default.** SVG files can embed ``/event handlers, so serving them from a public disk by URL is a stored-XSS vector. They are omitted from the default `allowed_extensions`; if you re-enable them, sanitize uploads (e.g. `enshrined/svg-sanitize`) or serve them with `Content-Disposition: attachment` / a restrictive CSP. Note the `image/*` MIME wildcard also matches `image/svg+xml`.

Changelog
---------

[](#changelog)

See [CHANGELOG.md](./CHANGELOG.md) for recent and upcoming changes.

Developer
---------

[](#developer)

Developed and maintained by [drpshtiwan](https://github.com/drpshtiwan).

License
-------

[](#license)

MIT License. See `LICENSE` for details.

###  Health Score

47

↑

FairBetter than 93% of packages

Maintenance94

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Total

5

Last Release

28d ago

Major Versions

1.1.0 → 2.0.02025-11-11

2.0.0 → 3.0.02026-02-11

3.0.0 → 4.0.02026-06-06

PHP version history (2 changes)1.0.0PHP &gt;=8.1

4.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3bae4eda28dfbd2e4a288a22c49c4a93c504c7b483e8d8353d7fea1eabcd921?d=identicon)[drpshtiwan](/maintainers/drpshtiwan)

---

Top Contributors

[![drpshtiwan](https://avatars.githubusercontent.com/u/6718949?v=4)](https://github.com/drpshtiwan "drpshtiwan (15 commits)")

---

Tags

laravellibrarymedialivewireselectoruploader

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/drpshtiwan-livewire-media-selector/health.svg)

```
[![Health](https://phpackages.com/badges/drpshtiwan-livewire-media-selector/health.svg)](https://phpackages.com/packages/drpshtiwan-livewire-media-selector)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[livewire/flux

The official UI component library for Livewire.

9527.8M126](/packages/livewire-flux)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M195](/packages/laravel-ai)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
