PHPackages                             jobsys/medialibrary-module - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. jobsys/medialibrary-module

ActiveLaravel-module[File &amp; Storage](/categories/file-storage)

jobsys/medialibrary-module
==========================

00PHP

Since Jun 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/jobsys/medialibrary-module)[ Packagist](https://packagist.org/packages/jobsys/medialibrary-module)[ RSS](/packages/jobsys-medialibrary-module/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

**MediaLibrary** 媒体库模块
======================

[](#medialibrary-媒体库模块)

为了让媒体资源，如图片、视频等内容可以重复利用，该模块提供一个媒体库组件 `MediaLibrary`，并集成了媒体文件上传、展示、选择等操作。默认提供 `图片`、`视频`、`文件`、`音频`和`其它`五个分类，如果需要添加新分类可以在 系统字典 `媒体库资源类型` 中添加字典项。

模块安装
----

[](#模块安装)

```
composer require jobsys/medialibrary-module
```

### 依赖

[](#依赖)

- PHP 依赖 （无）
- JS 依赖 （无）

### 配置

[](#配置)

#### 模块配置

[](#模块配置)

```
"MediaLibrary" => [
    "route_prefix" => "manager",                                                    // 路由前缀
]
```

模块功能
----

[](#模块功能)

### 媒体库功能

[](#媒体库功能)

媒体库中的资源遵循 [权限模板](module-permission.md?id=%E6%95%B0%E6%8D%AE%E6%9D%83%E9%99%90) 中的数据权限定义。上传的文件将如果是公共读写则存放在 `storage/app/public`，私有读写的文件存在放 `storage/app/private`，并会以文件的 `MIME 类型/日期/`进行分类存储。如:

```
- public
  - application
    - vnd.openxmlformats-officedocument.wordprocessingml.document
      - 20230428
        - Test_9fc219c4a2683ad5d96db5d2cf38e7b9.docx
  - image
    - jpeg
      - 20230325
        - bg1_286000046dc1b3e0f5cc0be11b043c72.jpeg
      - 20230326
        - bg1_286000046dc1b3e0f5cc0be11b043c73.jpeg

```

#### 开发规范

[](#开发规范)

1. 在页面引入 `MediaLibrary` 组件然后使用。

    ```
    import MediaLibrary from "@modules/MediaLibrary/Resources/views/web/components/MediaLibrary.vue"
    ```

    ```

    ```

    > 由于默认会对资源进行权限管理，所以需要在 `extra-data` 中传入当前操作的业务 `department_id`

    > 该上传支持`私有读写`，如果需要对资源`私有读写`，可以在 `extra-data` 中添加 `{type: private}`，如无设置则为公共读写。

模块代码
----

[](#模块代码)

### 数据表

[](#数据表)

```
2014_10_12_000005_create_media_libraries_table.php             # 审核模块数据表
```

### 数据模型/Scope

[](#数据模型scope)

```
Modules\MediaLibrary\Entitie\LibraryMedia             # 媒体文件
```

### Controller

[](#controller)

```
Modules\MediaLibrary\Http\Controllers\MediaLibraryController        # 提供上传以及 CRUD 功能
```

### UI

[](#ui)

#### PC 组件

[](#pc-组件)

```
web/components/MediaLibrary.vue        # 媒体库组件
```

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9af2852747d0afc832ab19afacd1b3bc0b727a8866ef728c8ccb3dc8ac75ca2a?d=identicon)[sinceow](/maintainers/sinceow)

---

Top Contributors

[![sinceow](https://avatars.githubusercontent.com/u/4105018?v=4)](https://github.com/sinceow "sinceow (1 commits)")

### Embed Badge

![Health badge](/badges/jobsys-medialibrary-module/health.svg)

```
[![Health](https://phpackages.com/badges/jobsys-medialibrary-module/health.svg)](https://phpackages.com/packages/jobsys-medialibrary-module)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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