Media Library

Folder-based file manager for images, videos, documents — used inside the admin and exposed over the API.

Routes

RouteMethodPurpose
/admin/mediaGETLibrary UI (folder tree + grid)
/admin/media/uploadPOSTUpload one or more files
/admin/media/foldersPOSTCreate folder
/admin/media/browseGETJSON file browser (for entry pickers)
/admin/media/movePOSTMove file to another folder
/admin/media/{mediaFile}GETFile detail page
/admin/media/{mediaFile}PUTUpdate metadata (name, alt, caption)
/admin/media/{mediaFile}DELETEDelete file (and underlying storage object)

Storage

Files are written to Laravel's public disk by default. Configure FILESYSTEM_DISK in .env to switch to S3, R2, or any other compatible driver — the model stores only the relative path, so the disk swap is transparent.

Metadata captured on upload

Folder tree

media_folders is self-referential — each folder has an optional parent_id. The browse endpoint returns the tree pre-flattened with breadcrumbs for the picker UI.

Image processing

Validation rules

file:         required, max 50 MB
mime:         image/*, video/mp4, application/pdf, etc.
folder_id:    optional UUID, must exist
alt_text:     optional string, max 255
caption:      optional string, max 500
Public API accessThe media library is also exposed under /api/v1/upload/* for authenticated API keys. See API: Media Upload.