Files
laralog/docs/media.md
T
goukiandCursor f81397a289 feat: use xpier media library for uploads and markdown embeds
Store media:ID in post bodies instead of CDN URLs, and keep sablog attach tokens as a fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 19:03:52 +00:00

33 lines
1.2 KiB
Markdown

# Media library (xpier)
New uploads, covers, and in-body images/files use `xpier/filament-media-library`. Sablog Spatie media / `attachments` rows stay for import and legacy shortcodes.
## Markdown body (do not paste CDN URLs)
The editor writes a **stable reference**. The public URL is resolved only when the page is rendered.
| Format | Image | File |
| -------- | ------------------ | ----------------------- |
| Markdown | `![alt](media:12)` | `[notes.pdf](media:12)` |
| HTML | `[media=12]` | `[media=12]` |
Admin flow: pick a file in **Insert from media library**, then click **Insert into body**. That appends the snippet above. Do not copy object-storage / CDN addresses into the article.
Legacy sablog tokens are unchanged: `[attach=ID]`, `{{attach:ID}}`, `![alt](attach:ID)`.
## Admin
- Library: `/admin/media-library`
- Folders: `/admin/media-folders` (defaults: `general`, `articles`, `banners`)
- Cover: `MediaPicker` bound to `coverMedia` / `cover_media_id`
## Config
```env
MEDIA_DISK=public
MEDIA_DIRECTORY=media
MEDIA_VISIBILITY=public
```
Run `php artisan storage:link` when using the `public` disk locally.