PHPackages                             binbinly/narwhalformmedia - 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. binbinly/narwhalformmedia

ActiveLibrary

binbinly/narwhalformmedia
=========================

Laravel - Admin Image Manager extension

v0.0.1(2y ago)035MITJavaScriptPHP &gt;=7.0.0

Since Jul 10Pushed 2y agoCompare

[ Source](https://github.com/binbinly/narwhalformmedia)[ Packagist](https://packagist.org/packages/binbinly/narwhalformmedia)[ Docs](https://github.com/Yelphp/narwhalformmedia)[ RSS](/packages/binbinly-narwhalformmedia/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Laravar-admin 图片管理拓展
====================

[](#laravar-admin-图片管理拓展)

[![图片名称](https://camo.githubusercontent.com/70b1b716bb607b2830e231f90a3a14c7d965a2972fee38111976ab25013c2062/68747470733a2f2f6c61726176656c2d61646d696e2e6f72672f73746f726167652f323032302f30382f31352f375a61785064536a765a593768307a546e77744a57703161444c6d636f746c6150596379485362732e706e67)](https://camo.githubusercontent.com/70b1b716bb607b2830e231f90a3a14c7d965a2972fee38111976ab25013c2062/68747470733a2f2f6c61726176656c2d61646d696e2e6f72672f73746f726167652f323032302f30382f31352f375a61785064536a765a593768307a546e77744a57703161444c6d636f746c6150596379485362732e706e67)

依赖
--

[](#依赖)

| php &gt;=7.0.0 | laravel-admin &gt;=~1.6

安装
--

[](#安装)

### composer 安装

[](#composer-安装)

```
composer require yelphp/narwhalformmedia

```

### 发布资源

[](#发布资源)

```
php artisan vendor:publish --provider=Narwhal\FormMedia\FormMediaServiceProvider

```

使用
--

[](#使用)

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

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

##### 可删除

[](#可删除)

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

```

##### 不可删除

[](#不可删除)

```
$form->photo('photo','图片')->limit(1)->remove(false)->help('单图，不可删除可删除');

$form->photo('photo','图片')->limit(1)->help('单图，可删除');

```

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

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

```
$form->photos('photo','图片')->limit(9)->remove(true);  //可删除

```

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

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

```
$form->video('video','视频')->limit(9)->remove(true);  //可删除

```

### 参数说明

[](#参数说明)

```
limit(int)      ： 图片限制条数
remove(boolean) :  是否有删除按钮

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);

	}

}

```

### Oss 使用

[](#oss-使用)

```
安装教程 ：https://github.com/jacobcyl/Aliyun-oss-storage

安装如果报错

Error Class 'Symfony\Component\Filesystem\Exception\FileNotFoundException' not found

则找到  出错文件 修改为：

    /**
     * @param $path
     *
     * @return string
     */
    public function getUrl( $path )
    {
        // if (!$this->has($path)) throw new FileNotFoundException($filePath.' not found');  //注释该行代码
        return ( $this->ssl ? 'https://' : 'http://' ) . ( $this->isCname ? ( $this->cdnDomain == '' ? $this->endPoint : $this->cdnDomain ) : $this->bucket . '.' . $this->endPoint ) . '/' . ltrim($path, '/');
    }

按照教程配置好了之后

把  admin.php 里面的  upload.disk  改为 oss  即可

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity28

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1034d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27fddeca3826c933f436c93a9f04c4138c1e9ad125bf9949dd91267ebdb5b67b?d=identicon)[binbinly](/maintainers/binbinly)

---

Top Contributors

[![Yelphp](https://avatars.githubusercontent.com/u/45053589?v=4)](https://github.com/Yelphp "Yelphp (15 commits)")

---

Tags

extensionlaravel-admin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/binbinly-narwhalformmedia/health.svg)

```
[![Health](https://phpackages.com/badges/binbinly-narwhalformmedia/health.svg)](https://phpackages.com/packages/binbinly-narwhalformmedia)
```

###  Alternatives

[laravel-admin-ext/grid-lightbox

Turn your grid into a lightbox &amp; gallery

58180.9k2](/packages/laravel-admin-ext-grid-lightbox)[laravel-admin-ext/wang-editor

wangEditor extension for laravel-admin

6283.4k](/packages/laravel-admin-ext-wang-editor)[laravel-admin-ext/sparkline

Integrates jQuery sparkline into laravel-admin

161.1k](/packages/laravel-admin-ext-sparkline)

PHPackages © 2026

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