cleaniquecoders/media-manager

Spatie Media Library Manager

Fund package maintenance!
Cleanique Coders

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 1

Open Issues: 0

pkg:composer/cleaniquecoders/media-manager

1.1.0 2026-01-20 16:23 UTC

This package is auto-updated.

Last update: 2026-01-20 16:28:09 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Laravel package that provides a complete media management solution built on top of Spatie Media Library. Manage your media files through a modern, user-friendly interface with Livewire components.

Features

  • Full-featured media browser with grid and list views
  • Drag-and-drop file uploads with progress tracking
  • Media collection management with reordering support
  • Media picker for selecting existing files
  • Search, filter, and bulk operations
  • Custom properties and metadata support
  • Authorization via Laravel gates
  • Fully customizable views

Screenshots

Media Browser

Browse all your media files with filtering, searching, and bulk operations.

Media Browser

Media Uploader

Upload files to any model with drag-and-drop support.

Media Uploader

Media Collection

Manage media collections inline with drag-and-drop reordering.

Media Collection

Installation

Install the package via Composer:

composer require cleaniquecoders/media-manager

Run the install command:

php artisan media-manager:install

Or manually publish and run migrations:

php artisan vendor:publish --tag="media-manager-migrations"
php artisan migrate

Optionally publish the config file:

php artisan vendor:publish --tag="media-manager-config"

Quick Start

1. Add the trait to your model

<?php

namespace App\Models;

use CleaniqueCoders\MediaManager\Concerns\HasMediaManager;
use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\HasMedia;

class Post extends Model implements HasMedia
{
    use HasMediaManager;

    public function registerMediaCollections(): void
    {
        $this->addMediaCollection('featured')->singleFile();
        $this->addMediaCollection('gallery');
    }
}

2. Add components to your views

{{-- Media Browser - embed in your own view with your layout --}}
<livewire:media-manager::browser />

{{-- Media Uploader --}}
<livewire:media-manager::uploader
    :model="$post"
    collection="gallery"
    :max-files="10"
/>

{{-- Media Collection Editor --}}
<livewire:media-manager::collection
    :model="$post"
    collection="gallery"
    sortable
/>

{{-- Media Picker --}}
<livewire:media-manager::picker
    wire:model="selectedMediaIds"
    multiple
/>

3. Create a route for the media browser

Create your own route and view to display the browser:

// routes/web.php
Route::get('/media', function () {
    return view('media');
})->middleware(['web', 'auth']);
{{-- resources/views/media.blade.php --}}
<x-app-layout>
    <livewire:media-manager::browser />
</x-app-layout>

Using the Facade

use CleaniqueCoders\MediaManager\Facades\MediaManager;

// Upload files
MediaManager::upload($model, $file, 'collection');
MediaManager::uploadMultiple($model, $files, 'collection');

// Browse with filters
$media = MediaManager::browse(['collection' => 'gallery'], perPage: 24);

// Delete media
MediaManager::delete($media);
MediaManager::deleteMultiple([1, 2, 3]);

Documentation

For detailed documentation, see the docs directory:

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.