Skip to content
Skills Library
Programming · Building & coding

admin-attachments

/admin-attachments

Use when a module record needs uploaded files (scans, documents, photos, attachments) stored privately with signed downloads.

Licence
MIT
Last repository change
08.11.2026

Assessment and security

96/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content31 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 08.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when a module record needs uploaded files (scans, documents, photos, attachments) stored privately with signed downloads.

Original author description

Use when a module record needs uploaded files (scans, documents, photos, attachments) stored privately with signed downloads.

How it works

SKILL.md has no level-two headings · 22 lines, 172 words

SKILL.md preview
---
name: admin-attachments
description: "Use when a module record needs uploaded files (scans, documents, photos, attachments) stored privately with signed downloads."
---

# Add attachments to a model

The generator does all of this for a `name:file(single|multiple, required, pdf|jpg, 2048)` field. By hand:

1. Model: `use HasAttachments;` and declare the slots:
   ```php
   public function attachmentSlots(): array
   {
       return [
           'scan_ktp' => AttachmentSlot::single(__('Scan KTP'))->required()->mimes(['pdf', 'jpg', 'png'])->maxKb(2048),
           'lampiran' => AttachmentSlot::multiple(__('Lampiran')),
       ];
   }
   ```
2. Routes: `AttachmentController::routes({Name}::class);` (signed URL and download with `{slug}.view`, delete with `{slug}.edit`).
3. Input Data: `#[LiteralTypeScriptType('Record<string, File | File[] | null>')] public array $files = []`, rules `...AttachmentUploads::rules({Name}::class)` (on update pass the record), attributes `...AttachmentUploads::attributes({Name}::class)`.
4. Controller `store` / `update`: `AttachmentUploads::saveWith(fn () => ..., $data->files, $request->user())`, saving `$data->except('files')`. Create, Edit and Show send `'attachments' => AttachmentController::data($record, $request->user())`.
5. Pages: the form renders `<AttachmentFields slots={attachments.slots} value={data.files ?? {}} errors={errors} onChange={(files) => form.setData('files', files)} />`; the edit form posts with `update.form(id).action` (POST + `_method=PUT`, so files travel); Show has a Lampiran tab with `<AttachmentSlots slots={attachments.slots} />`.
6. Files land on the private `admin-core.attachments.disk` under random names; downloads are 5-minute signed URLs; upload, download and delete are audited. Never use the public disk.
7. `composer check`.

Versions

The database has no other skills named admin-attachments.

Database snapshot: 13.11.2026 · package version 48d7d16725ce (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90Linear Attachments
    This skill should be used when uploading files to Linear, linking external URLs as attachments, or downloading existing attachments with auth. Activates on "linear attachment", "linear file upload", "fileUpload mutation", "attachmentLinkCreate".
  • 100admin-make-module
    Use when creating a new admin module (a new feature, CRUD screen, master data or list of records) in a yuanmaharsyah/admin-core project. Runs php artisan make:module and finishes what it wrote.
  • 86admin-test-module
    Use when writing or fixing tests for an admin module: permissions, guests, validation, audit, soft delete, visibility scope, widgets.
  • 100gh-attach
    Uploads a local file (screenshot, image, PDF, zip, video) to GitHub user-attachments, downloads GitHub user-attachments, and embeds local files in a PR, issue, or comment. Use when asked to "attach a screenshot to the PR", "add an image to the issue", "embed before/after…
  • 100github-attachments
    Upload images and files to GitHub PRs, issues, and comments so GitHub hosts them instead of committing binaries to the repository. Use when adding screenshots to a PR or issue body, replacing committed screenshots or raw.githubusercontent.com links with hosted attachments, or…
  • 100peekie-attachments
    Extract and list test attachments (screenshots, logs, blobs) from an Xcode `.xcresult` bundle via `peekie attachments`. Trigger when the user asks about attached files in a bundle — e.g. "extract failure screenshots from /tmp/Tests.xcresult to /tmp/out", "save attachments for a…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.