Available actions
Import classes fromUseFlex\MediaStudio\Integrations\Filament\Actions.
The standard Filament methods remain available, including
label(), icon(),
color(), visible(), authorize(), lifecycle hooks and notifications.
Studio checks workspace membership and source ownership when an operation runs.
Configuring an action’s visibility does not grant permission to its underlying file.
Add a page action
A page that uses native Filament actions can expose this method. The workspace comes from trusted application state. For a plain Livewire component, implement Filament’sHasActions and HasSchemas contracts and their interaction traits.
Map your table record to a Studio file
The application’s model may hold a Studio asset ID while its own primary key identifies a separate record. Supplyentry() to resolve the current Studio ID
and revision. Keep this mapping on the server.
public_id and an integer revision from the record. Add an integer cast for
revision to that Eloquent model. Array records also need the unique
__key required by Filament.
An open mutation form carries an encrypted confirmation bound to the member,
workspace, action, entry selection and revisions. Confirmation expires after
30 minutes. Changing the file in another session produces a conflict. Reopen
the action to review the current file before trying again.
afterEntry(fn (object $entry) => ...) receives the updated Studio row after
a successful single-entry mutation. Use normal Filament hooks to integrate
application-specific behavior.
Add bulk actions
On a native Filament table backed by Studio entry models, register toolbar actions. This example assumes the table query is already scoped to the current application’s authorized workspace and castsrevision to integer.
entry() so resolving selected records does not issue one extra
query for each item. afterEntries(fn (array $entries) => ...) receives updated
Studio rows after a successful bulk mutation.
Select or upload a file from a button
Provide the browser bundle and stylesheet URLs published by your application. The picker uses the shared Studio transfer queue, chunk configuration and workspace permissions.onSelect(), the action
dispatches media-studio-file-selected with a reference payload. Save
application usage references in the same transaction as your owning record.
See library references and configuration.
For the native MarkdownEditor or RichEditor toolbar, use the dedicated
editor adapters.
Individual actions
CreateFolderAction
Choose the workspace root or an authorized managed folder as the parent. The action validates the name and runs with the current workspace write permissions.RenameAction
The dialog starts with the current name. The confirmation binds the entry revision. If another user renames or moves that entry before submission, reopen the dialog with fresh data.recordActions(). Map the record to a Studio public ID and positive integer revision, either through native attributes or the entry() callback. Use afterEntry() to refresh application state after the mutation succeeds.
MoveAction
Choose a destination folder or the workspace root. The server validates the current folder hierarchy and rejects a move into the entry’s own subtree.recordActions(). Map the record to a Studio public ID and positive integer revision, either through native attributes or the entry() callback. Use afterEntry() to refresh application state after the mutation succeeds.
TrashAction
Use this action for reversible removal. The Studio trash policy applies to folders and files. Permanent deletion is managed separately.recordActions(). Map the record to a Studio public ID and positive integer revision, either through native attributes or the entry() callback. Use afterEntry() to refresh application state after the mutation succeeds.
RestoreAction
Use this action on a records query for trashed Studio entries. Studio checks restore rights and applies its current destination and collision rules.recordActions(). Map the record to a Studio public ID and positive integer revision, either through native attributes or the entry() callback. Use afterEntry() to refresh application state after the mutation succeeds.
DownloadAction
The action resolves the mapped asset’s current version and redirects to Studio’s authorized download URL. The download endpoint checks permission when the file is requested.recordActions(). Map the record to a Studio public ID and positive integer revision, either through native attributes or the entry() callback.
SelectFileAction
The modal resolves one pinned file reference. The upload capability is governed by the workspace and user. Use the low-level StudioPicker when your action needs custom selection controls.media-studio-file-selected with a reference payload. Save the host record and register its usage when the selection is committed.
Bulk actions
MoveBulkAction
Choose one authorized target folder for the entire selection. The folder hierarchy and each entry revision are checked before the move.toolbarActions(). Use an authorized table query and explicit row selection, up to 100 entries. A denied, missing or stale entry rejects the bulk operation. The callback receives the updated Studio rows.
TrashBulkAction
The action applies reversible trash semantics to the selection. Authorization and source restrictions apply to every item.toolbarActions(). Use an authorized table query and explicit row selection, up to 100 entries. A denied, missing or stale entry rejects the bulk operation. The callback receives the updated Studio rows.
RestoreBulkAction
Use a table showing trashed records. Each entry must still be eligible for restore when the action runs.toolbarActions(). Use an authorized table query and explicit row selection, up to 100 entries. A denied, missing or stale entry rejects the bulk operation. The callback receives the updated Studio rows.