承接 cleaniquecoders/media-manager 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cleaniquecoders/media-manager

Composer 安装命令:

composer require cleaniquecoders/media-manager

包简介

Spatie Media Library Manager

README 文档

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.

统计信息

  • 总下载量: 2k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固