creativehabib/media-manager 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

creativehabib/media-manager

Composer 安装命令:

composer require creativehabib/media-manager

包简介

Laravel media manager like Botble CMS

README 文档

README

A Livewire v3-powered media manager for Laravel applications. It provides a Botble-like media library with uploads, tagging, folders, favorites, trash management, and basic image optimization features.

Requirements

  • PHP 8.2+
  • Laravel with Livewire 3 installed
  • intervention/image-laravel
  • intervention/image
  • Tailwindcss
  • Fontawesome

Features

  • 📁 Folder-based file manager
  • 🏷️ Tags & search filters
  • 🖼️ Image preview, crop & optimize
  • ☁️ Multiple disks (e.g. public, s3)
  • 🗑️ Trash, restore, and permanent delete
  • ⭐ Favorites
  • 🔗 Direct & indirect shareable URLs
  • 📤 Upload from local or external URL
  • ⚡ Livewire-powered UI (no page reloads)
  • 🧩 Ready-made Blade partials:
  • media-input for input + preview
  • media-modal for the media gallery modal
  • media-toast for toasts/notifications -Easy integration with:
  • Any simple <input> field
  • CKEditor (or any rich text editor)

Installation

  1. Install the package via Composer:
     composer require creativehabib/media-manager intervention/image intervention/image-laravel
  2. Publish the configuration (and adjust disks, route prefix, middleware, or permissions as needed):
    php artisan vendor:publish --provider="Habib\\MediaManager\\MediaManagerServiceProvider" --tag=config
  3. Run the migrations to create the media tables:
    php artisan migrate

Configuration

The published config/mediamanager.php file lets you control several behaviors:

  • disks: which filesystem disks can be managed (default: public, s3, do_spaces).
  • default_disk: disk used when none is specified.
  • route_prefix: base URL for the bundled routes (default: admin/media).
  • middleware: middleware stack protecting the routes (default: ['web', 'auth']).
  • permission: optional Gate ability checked before allowing access (default: manage_media).
  • per_page: pagination size for the media listing.
  • toast: toast notification defaults (position, timeout, queue length).

Usage

Routes

The service provider automatically registers routes under the configured prefix, guarded by the configured middleware and optional permission check. Visit /admin/media (or your configured prefix) to access the media manager page.

Livewire component

Render the media manager anywhere in your app:

<livewire:media-manager />
{{-- or --}}
@livewire('media-manager')

Blade input helper

Drop a media picker + preview into any form field:

@include('mediamanager::includes.media-input', [
    'name'  => 'site_logo',
    'id'    => 'site_logo',
    'label' => 'Site Logo',
    'value' => $site_logo,
])

Modal include

To open the manager inside a modal and let users pick media for form fields, include the packaged modal partial and trigger it via the provided JavaScript helpers:

@include('mediamanager::includes.media-modal')

<button type="button" onclick="openMediaManager('thumbnail')">Select media</button>
<input type="hidden" id="thumbnail" name="thumbnail"> <!-- populated when a file is chosen -->

The modal listens for open-media-manager and close-media-manager events and dispatches media-insert when users confirm selection.

View publishing

If you need to customize the views, publish them:

php artisan vendor:publish --provider="Habib\\MediaManager\\MediaManagerServiceProvider" --tag=mediamanager-views
# or publish everything under the mediamanager namespace
php artisan vendor:publish --provider="Habib\\MediaManager\\MediaManagerServiceProvider" --tag=mediamanager-all

Features

  • Upload files from local devices or by URL, storing them on the configured disks.
  • Organize files into folders, tag them, and search/filter by name, tag, MIME type, visibility, date range, or folder.
  • Mark items as favorites, manage trash, and view recent uploads.
  • Image uploads automatically record dimensions; cropping and optimization options are built in for image assets.
  • Optional Gate permission check to restrict access to authorized users.

creativehabib/media-manager 适用场景与选型建议

creativehabib/media-manager 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 2.88k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 creativehabib/media-manager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 creativehabib/media-manager 我们能提供哪些服务?
定制开发 / 二次开发

基于 creativehabib/media-manager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-22