PHPackages                             guapikeji/form-media - 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. guapikeji/form-media

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

guapikeji/form-media
====================

Dcat-admin image/video input extension. / Dcat-admin表单媒体扩展。

v1.0.10(10mo ago)0537MITJavaScriptPHP &gt;=7.2.5

Since Sep 14Pushed 10mo agoCompare

[ Source](https://github.com/guapikeji/dcat-form-media)[ Packagist](https://packagist.org/packages/guapikeji/form-media)[ Docs](https://github.com/guapikeji/dcat-form-media)[ RSS](/packages/guapikeji-form-media/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (12)Used By (0)

Dcat-admin 表单媒体拓展
=================

[](#dcat-admin-表单媒体拓展)

预览
--

[](#预览)

### 表单

[](#表单)

[![form](https://user-images.githubusercontent.com/24578855/105875109-5aa30400-6038-11eb-9b5c-1c833e0c6b92.jpg)](https://user-images.githubusercontent.com/24578855/105875109-5aa30400-6038-11eb-9b5c-1c833e0c6b92.jpg)

### 动态表单

[](#动态表单)

[![form-array](https://user-images.githubusercontent.com/24578855/145700810-e648aa6e-4753-42a4-9fef-d5f397536ba3.jpg)](https://user-images.githubusercontent.com/24578855/145700810-e648aa6e-4753-42a4-9fef-d5f397536ba3.jpg)

### 弹出选择框

[](#弹出选择框)

[![form-modal](https://user-images.githubusercontent.com/24578855/104125985-1277b680-5395-11eb-835b-c20e7c7585f9.jpg)](https://user-images.githubusercontent.com/24578855/104125985-1277b680-5395-11eb-835b-c20e7c7585f9.jpg)

环境
--

[](#环境)

- PHP &gt;= 7.2.5
- Dcat-admin ^2.0

安装
--

[](#安装)

### composer 安装

[](#composer-安装)

```
composer require lake/form-media

```

### 安装扩展

[](#安装扩展)

在 `开发工具->扩展` 安装本扩展

使用
--

[](#使用)

#### 单图 数据库结构 varchar

[](#单图-数据库结构-varchar)

##### 可删除

[](#可删除)

```
$form->photo('photo','图片')
    ->nametype('datetime')
    ->remove(true)
    ->help('单图，可删除');

```

##### 不可删除

[](#不可删除)

```
$form->photo('photo','图片')
    ->path('pic')
    ->nametype('uniqid')
    ->remove(false)
    ->help('单图，不可删除');

$form->photo('photo','图片')
    ->nametype('uniqid')
    ->help('单图，不可删除');

```

#### 多图 数据库结构 json

[](#多图-数据库结构-json)

```
$form->photos('photo', '图片')
    ->path('pic')
    ->pageSize(16)
    ->nametype('uniqid')
    ->limit(9)
    ->remove(true);  //可删除

```

#### 视频 数据库结构 json/varchar

[](#视频-数据库结构-jsonvarchar)

```
$form->video('video','视频')
    ->path('video')
    ->nametype('uniqid')
    ->remove(true);  //可删除

```

### 参数说明

[](#参数说明)

```
path(string)         ： 快速定位目录，默认为根目录
nametype(string)     ： 文件重命名方式 uniqid|datetime|sequence|original，默认 uniqid
accept(string)       ： 设置 input accept 属性, 自定义，默认类型不设置
pageSize(int)        ： 弹出层列表每页显示数量
limit(int)           ： 限制条数
remove(boolean)      :  是否有删除按钮
saveFullUrl(boolean) :  是否保存完整链接
disk(string)         :  文件存储的磁盘，具体信息可以查看 `config/filesystems.php`

photo 、 photos 、 video 的参数默认值不一样

photo  默认 limit = 1  remove = false

photos 默认 limit = 9  remove = true

video  默认 limit = 1  remove = true

```

##### 多图上传提交的数据为 json 字符串，如需输出数组，请在对应模型中加入下面代码

[](#多图上传提交的数据为-json-字符串如需输出数组请在对应模型中加入下面代码)

```
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Demo extends Model
{

    public function getPicturesAttribute($pictures)
    {

        return json_decode($pictures, true);

    }

}

```

开源协议
----

[](#开源协议)

- 本扩展遵循 `MIT` 开源协议发布，在保留本扩展版权的情况下提供个人及商业免费使用。

版权
--

[](#版权)

- 该系统所属版权归 deatil() 所有。

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance53

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.7% 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 ~31 days

Recently: every ~2 days

Total

10

Last Release

325d ago

### Community

Maintainers

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

---

Top Contributors

[![deatil](https://avatars.githubusercontent.com/u/24578855?v=4)](https://github.com/deatil "deatil (67 commits)")[![themismin](https://avatars.githubusercontent.com/u/5857863?v=4)](https://github.com/themismin "themismin (15 commits)")

---

Tags

mediaextensiondcat adminform-mediaguapikeji

### Embed Badge

![Health badge](/badges/guapikeji-form-media/health.svg)

```
[![Health](https://phpackages.com/badges/guapikeji-form-media/health.svg)](https://phpackages.com/packages/guapikeji-form-media)
```

###  Alternatives

[lake/form-media

Dcat-admin image/video input extension. / Dcat-admin表单媒体扩展。

686.8k](/packages/lake-form-media)[yiimaker/yii2-social-share

Extension for sharing on social networks

48111.3k4](/packages/yiimaker-yii2-social-share)[okipa/laravel-medialibrary-ext

Extra features for spatie/laravel-medialibrary package.

1011.2k](/packages/okipa-laravel-medialibrary-ext)[abovesky/dcat-media-player

Dcat Admin 音视频预览扩展

202.3k](/packages/abovesky-dcat-media-player)[somehow-digital/typo3-media-processing

Media Processing

101.1k](/packages/somehow-digital-typo3-media-processing)[asgardcms/media-module

Media module for AsgardCMS. Handles the media library.

1130.6k2](/packages/asgardcms-media-module)

PHPackages © 2026

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