Skip to content

Media Manager ​

The media manager is a full library UI: a folder tree, search, type filters, a grid with hover actions, an inspector panel, rename and move, bulk delete and move, and uploads into the open folder.

Built-in page ​

Visit /mediaflow/manager (route mediaflow.manager). /mediaflow opens the same page.

Query parameterEffect
?clean=1 or ?embed=1Hide the header, for iframes and modals.
?no_uploader=1Hide the upload area and show only folders and files.
?folder_id=12Open a specific folder.

The header can be turned off everywhere with MEDIAFLOW_SHOW_HEADER=false. Links to the docs and pipeline pages appear in it only when MEDIAFLOW_DEV_NAV=true.

Embedding the component ​

blade
<x-mediaflow::manager />

<x-mediaflow::manager> and <x-mediaflow-manager> are the same component.

OptionTypeDefaultDescription
modestringstandalonestandalone for a library, or picker to add a Select media button.
multipleboolfalseAllow selecting several items in picker mode.
namestringselected_media_idInput name used in picker mode.
folder-idintnullFolder to open first. folder is an alias.
collectionstringnullLimit the library to one collection.
pipelineboolui.show_pipeline (on)Show the pipeline animation for uploads. visualizer is an alias.
themestringsettingsAccent preset; see Theming.
color-modestringsettingslight, dark or system.
folder-colorstringsettingsHex colour for folder icons.

Picker mode ​

blade
<x-mediaflow::manager mode="picker" :multiple="true" />

When the user clicks Select media, the component dispatches mediaflow:picked:

js
document.addEventListener('mediaflow:picked', (e) => {
  const { item, items } = e.detail // first selection and all selections
  console.log(items.map((m) => m.id))
})

Folder changes ​

Opening a folder dispatches mediaflow:folder-changed on document with { folderId, folderName }. Uploaders on the same page use it to upload into the open folder.

Folder rules ​

  • Folder names are unique within their parent.
  • Renaming or moving a folder updates its slug and the paths of all descendants.
  • A folder cannot be moved into its own subtree.
  • Deleting a folder moves its files and subfolders up to the parent.

Who can do what ​

Everyone who passes access control can upload, rename, move and delete. The ui.allow_delete, ui.allow_rename and ui.allow_move keys in config/mediaflow.php are reserved and not enforced yet, so restrict destructive actions with roles, a gate or MediaFlow::authorize().

Released under the MIT License.