Store media:ID in article bodies instead of CDN URLs, and keep sablog attach tokens as a fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
1.1 KiB
1.1 KiB
Media library (xpier)
New uploads, covers, and in-body images/files use xpier/filament-media-library. The sablog attachments table and attach: protocol stay for import/legacy content.
Markdown body (do not paste CDN URLs)
Store a library id, never a bucket/CDN URL. Rendering expands it to the current public URL.
| Format | Image | File |
|---|---|---|
| Markdown |  |
[notes.pdf](media:12) |
| HTML | [media=12] |
[media=12] |
Admin flow: pick a file, then Insert into body. Markdown keeps media:ID; HTML keeps [media=ID].
Legacy tokens stay valid: , [attach=ID], /attachment.php?id=ID.
Admin
- Library:
/admin/media-library - Folders:
/admin/media-folders(defaults:general,articles,banners) - Cover:
cover_media_idviaMediaPicker(coverMediarelation).cover_pathremains for older auto-covers.
Config
MEDIA_DISK=public
MEDIA_DIRECTORY=media
MEDIA_VISIBILITY=public
Run php artisan storage:link when using the public disk locally.