PHPackages                             lyrasoft/attachment - 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. lyrasoft/attachment

ActiveWindwalker-package

lyrasoft/attachment
===================

LYRASOFT attachment package

1.1.1(3mo ago)04.7k↑14.9%3[8 issues](https://github.com/lyrasoft/luna-attachment/issues)1MITPHPPHP &gt;=8.4.6

Since Jul 26Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/lyrasoft/luna-attachment)[ Packagist](https://packagist.org/packages/lyrasoft/attachment)[ RSS](/packages/lyrasoft-attachment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (10)Used By (1)

LYRASOFT Attachment Uploader Package
====================================

[](#lyrasoft-attachment-uploader-package)

[![screenshot 2022-01-13 下午04 01 08](https://user-images.githubusercontent.com/34531644/180942543-b1cdd90e-e743-46af-9888-053a2388d9af.png)](https://user-images.githubusercontent.com/34531644/180942543-b1cdd90e-e743-46af-9888-053a2388d9af.png)

安裝
--

[](#安裝)

```
composer require lyrasoft/attachment
```

然後複製 migration 檔案

```
php windwalker pkg:install lyrasoft/attachment -t migrations
```

如果需要更改 entity、repo 時可複製出來

```
php windwalker pkg:install lyrasoft/attachment -t migrations -t entity -t attachment_modal
```

使用
--

[](#使用)

先到 `unicorn.php` 中註冊 `AttachmentPackage`

```
'unicorn' => [

        .....

        'providers' => [
            \Lyrasoft\Attachment\AttachmentPackage::class,
        ],
]

```

```

```

### Options

[](#options)

namerequireDescidfalse欄位 id，預設帶隨機碼，需要 JS 控制可以自訂namefalse欄位名稱，會自動後綴 `[]`，預設是 `attachments`itemstrue提供已上傳檔案列表做使用insertBtnfalse插入文章的btn，可以是 `true` 或 Tinymce element 的選擇器acceptfalse限制檔案類型mutiplefalse可上傳複數檔案如果要單獨使用 檔案列表 或是 上傳Input的話 也可以單獨使用

```

```

JS
--

[](#js)

在需要使用的頁面 ts中 使用 `useAttachment()` 載入

```
import { useAttachment } from '@lyrasoft/attachment';

useAttachment();
```

Slot
----

[](#slot)

如果你想自訂額外的按鈕的動作，可以用 `buttons` slot

```

                @scope($item, $i)

                Do anything with $item

```

元件個別引入
------

[](#元件個別引入)

- ``: 最完整的元件，包含 list &amp; uploader
- ``: 使用 file-drag 做的上傳器
- ``: 上傳附件列表

### 備註

[](#備註)

1. 記得要在 view 中利用`repo` 或是 `ORM` 取出 attachments 並塞入 field 的 option 中。
2. 在controller 內記得寫儲存及刪除的內容, 有刪除檔案的話可以從 `$app->input()` 中取得 `remove_attachments` 裡面是 attachment 的 ID

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance86

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 54.3% 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 ~159 days

Recently: every ~201 days

Total

9

Last Release

104d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1639206?v=4)[Simon Asika](/maintainers/asika32764)[@asika32764](https://github.com/asika32764)

---

Top Contributors

[![asika32764](https://avatars.githubusercontent.com/u/1639206?v=4)](https://github.com/asika32764 "asika32764 (25 commits)")[![chokeslam](https://avatars.githubusercontent.com/u/34531644?v=4)](https://github.com/chokeslam "chokeslam (18 commits)")[![yinminc](https://avatars.githubusercontent.com/u/28665511?v=4)](https://github.com/yinminc "yinminc (3 commits)")

### Embed Badge

![Health badge](/badges/lyrasoft-attachment/health.svg)

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

PHPackages © 2026

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