PHPackages                             hanson/laravel-admin-sku - 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. [Admin Panels](/categories/admin)
4. /
5. hanson/laravel-admin-sku

ActiveLibrary[Admin Panels](/categories/admin)

hanson/laravel-admin-sku
========================

1.0(6y ago)55685MITJavaScriptPHP &gt;=7.0.0

Since Sep 15Pushed 6y agoCompare

[ Source](https://github.com/Hanson/laravel-admin-sku)[ Packagist](https://packagist.org/packages/hanson/laravel-admin-sku)[ Docs](https://github.com/jade-kun/sku)[ RSS](/packages/hanson-laravel-admin-sku/feed)WikiDiscussions master Synced 2d ago

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

laravel-admin extension 商品SKU
=============================

[](#laravel-admin-extension-商品sku)

[![预览](https://github.com/jade-kun/sku/raw/master/1.png?raw=true)](https://github.com/jade-kun/sku/blob/master/1.png?raw=true)

安装
--

[](#安装)

```
composer require hanson/laravel-admin-sku

php artisan vendor:publish --tag=sku
```

配置
--

[](#配置)

### 配置sku上传地址

[](#配置sku上传地址)

文件路径 `public/vendor/hanson/sku/sku.js`

```
const UploadHost = '/admin/upload_file';
```

php进行存储

```
// key为file
if($request->hasFile('file')) {
    $file = $request->file('file');
    $path = $file->store('images');

    // 返回格式
    return ['url'=> Storage::url($path)];
}
```

使用
--

[](#使用)

```
$form->sku('sku','商品SKU')->default($json);

// 处理数据
$form->saving(function($form) {
    dd($form->sku);
});
```

本扩展只会将SKU数据写指定的字段中，如需个性化处理数据，请在【表单回调】中处理

原始数据

```
{
	"type": "many", // many多规格；single单规格
	"attrs": {"尺寸": ["XL", "XXL", "XXXL"], "颜色": ["黑", "灰色"]},
    "sku": [{"pic": "", "price": "89", "stock": "100", "尺寸": "XL", "颜色": "黑"}, {
        "pic": "",
        "price": "89",
        "stock": "100",
        "尺寸": "XL",
        "颜色": "灰色"
    }, {"pic": "", "price": "89", "stock": "100", "尺寸": "XXL", "颜色": "黑"}, {
        "pic": "",
        "price": "89",
        "stock": "100",
        "尺寸": "XXL",
        "颜色": "灰色"
    }, {"pic": "", "price": "89", "stock": "100", "尺寸": "XXXL", "颜色": "黑"}, {
        "pic": "",
        "price": "89",
        "stock": "100",
        "尺寸": "XXXL",
        "颜色": "灰色"
    }]
}
```

自定义 sku 数据
----------

[](#自定义-sku-数据)

以下操作均为修改 `public/vendor/hanson/sku/sku.js`

### 例子

[](#例子)

- 增加一列 SKU 编号

`第231行`

```
tbody_html += '+清空';
tbody_html += '';
tbody_html += '';
tbody_html += '';

tbody_html += '';
tbody_html += ''
```

- 给上面的 sku 编号增加全局输入

`第9行`

```
this.commonStock = 0; // 统一库存
this.commonPrice = 0; // 统一价格
this.commonSku = ''; // 统一sku
this.init();
```

`第96行`

```
// 统一sku
_this.warp.find('.sku_edit_warp thead').on('keyup', 'input.Js_sku', function () {
    _this.commonStock = $(this).val();
    _this.warp.find('.sku_edit_warp tbody td[data-field="sku_no"] input').val(_this.commonStock);
    _this.processSku()
});
```

`第203行`

```
thead_html += '图片';
thead_html += '价格 ';
thead_html += '库存 ';
thead_html += 'sku ';
thead_html += '';
```

`第231行`

```
tbody_html += '+清空';
tbody_html += '';
tbody_html += '';
tbody_html += '';

tbody_html += '';
tbody_html += ''
```

- 去掉 sku 图片

`231行处` 把 pic 的一行删掉

```
tbody_html += '';
tbody_html += '';
tbody_html += '';
tbody_html += ''
```

感谢
--

[](#感谢)

感谢 jade-kun 的 [sku](https://github.com/jade-kun/sku) 项目，此项目在原项目中修改并加以完善

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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

2431d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10583423?v=4)[hanson](/maintainers/hanson)[@Hanson](https://github.com/Hanson)

---

Top Contributors

[![Hanson](https://avatars.githubusercontent.com/u/10583423?v=4)](https://github.com/Hanson "Hanson (2 commits)")

---

Tags

extensionlaravel-admin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hanson-laravel-admin-sku/health.svg)

```
[![Health](https://phpackages.com/badges/hanson-laravel-admin-sku/health.svg)](https://phpackages.com/packages/hanson-laravel-admin-sku)
```

###  Alternatives

[laravel-admin-ext/wang-editor

wangEditor extension for laravel-admin

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

382.2k](/packages/jadekun-sku)[jonexyz/wang-editor-v4

laravel admin editor

161.4k](/packages/jonexyz-wang-editor-v4)[namet/laravel-admin-tagsinput

tagsinput for laravel-admin Form

102.7k](/packages/namet-laravel-admin-tagsinput)

PHPackages © 2026

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