PHPackages                             themismin/laravel-admin-ext-cos - 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. themismin/laravel-admin-ext-cos

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

themismin/laravel-admin-ext-cos
===============================

简单的大文件分片直传腾讯云 COS 的 laravel-admin 扩展

v1.1.0(1mo ago)088MITPHPPHP &gt;=7.0.0

Since May 16Pushed 1mo agoCompare

[ Source](https://github.com/themismin/laravel-admin-ext-cos)[ Packagist](https://packagist.org/packages/themismin/laravel-admin-ext-cos)[ Docs](https://github.com/themismin/laravel-admin-ext-cos)[ RSS](/packages/themismin-laravel-admin-ext-cos/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

laravel-admin-ext-cos
=====================

[](#laravel-admin-ext-cos)

腾讯云 COS 浏览器分片直传组件，适用于 `encore/laravel-admin`。

安装
--

[](#安装)

```
composer require themismin/laravel-admin-ext-cos:^1.1
php artisan vendor:publish --provider="ThemisMin\\LaravelAdminExtCos\\CosJsUploadServiceProvider" --tag=cos-js-upload
php artisan vendor:publish --provider="ThemisMin\\LaravelAdminExtCos\\CosJsUploadServiceProvider" --tag=cos-js-upload-config
```

扩展会自动注册 `cosupload` 表单字段。旧项目也可以在 `app/Admin/bootstrap.php` 中显式注册：

```
Encore\Admin\Form::extend(
    'cosupload',
    \ThemisMin\LaravelAdminExtCos\CosJsUploadField::class
);
```

环境变量
----

[](#环境变量)

```
APP_NAME=example
COS_SECRET_ID=
COS_SECRET_KEY=
COS_BUCKET=
COS_REGION=ap-shanghai
COS_URL=https://example-123456.cos.ap-shanghai.myqcloud.com/
```

字段类型
----

[](#字段类型)

```
$form->cosupload('cover', '封面')
    ->image()
    ->storeFullUrl();

$form->cosupload('video', '视频')->video();
$form->cosupload('attachment', '附件')->file();
```

默认规则：

- 图片：jpg、jpeg、png、webp、gif、bmp、svg，最大 20 MB。
- 视频：mp4、mov、webm、avi、mkv、m4v，最大 2 GB。
- 文件：PDF、Office、文本、CSV 和常见压缩包，最大 500 MB。

字段可覆盖默认限制：

```
$form->cosupload('cover', '封面')
    ->image()
    ->extensions(['jpg', 'png'])
    ->mimeTypes(['image/jpeg', 'image/png'])
    ->maxSize(5)
    ->storeFullUrl();
```

未调用 `image()`、`video()` 或 `file()` 的旧字段保持无限制。

上传安全
----

[](#上传安全)

- 浏览器在申请上传授权前校验扩展名、MIME 和大小。
- 上传策略使用 Laravel 加密令牌，客户端无法放宽规则。
- 授权接口由 laravel-admin 的 `web` 和 `admin` 中间件保护，并使用 CSRF。
- STS 临时凭证只允许写入本次生成的对象 Key。
- 对象 Key 格式为 `{APP_NAME}/{type}/YYYY/MM/DD/UUID.ext`。

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance90

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity31

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

Every ~12 days

Total

3

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c800de9c17265b0c85ee3c8e2be6f196b2dfb0c0a5692f5d7ca9e8ee6064df2?d=identicon)[themismin](/maintainers/themismin)

---

Top Contributors

[![guapikeji](https://avatars.githubusercontent.com/u/181543470?v=4)](https://github.com/guapikeji "guapikeji (3 commits)")

---

Tags

laravelextensionlaravel-admincos

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/themismin-laravel-admin-ext-cos/health.svg)

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

###  Alternatives

[dianwoung/large-file-upload

An extension of laravel-admin for uploading large files

7748.1k2](/packages/dianwoung-large-file-upload)[catlane/chunk-file-upload

文件上传小扩展，可支持大文件分块分片上传到七牛云or本地，优化您上传大文件的苦恼

284.9k](/packages/catlane-chunk-file-upload)[jxlwqq/file-manager

file manager for laravel-admin

1115.8k](/packages/jxlwqq-file-manager)[laravel-admin-ext/file-browser

A file browser for laravel-admin

153.0k](/packages/laravel-admin-ext-file-browser)

PHPackages © 2026

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