Skip to content

Configuration ​

Publish the file with php artisan vendor:publish --tag=filament-media-library-config, or run php artisan media-library:install. The config lives at config/filament-media-library.php.

Inside a Filament panel, the fluent options on the plugin override features, browser, upload.accepted_mime_types, upload.max_file_size, upload.duplicates and tenancy. Outside panels, this file is the only place to set them.

Models and tables ​

KeyTypeDefaultWhat it does
models.itemclass-stringMediaItem::classThe model for library files. Swap it to extend the built-in model.
models.folderclass-stringMediaFolder::classThe folder model.
models.tagclass-stringMediaTag::classThe tag model.
models.attachmentclass-stringMediaAttachment::classThe pivot model that records where a file is used.
table_prefixstring'media_library_'Prefix for the library tables.
user_modelclass-string or nullnullThe model for uploaders and owners. null uses your auth provider's model.

Key types ​

Set these before you run the migration.

KeyTypeDefaultWhat it does
key_types.userint, uuid, ulid or string'int'Column type for uploaded_by and created_by.
key_types.tenantsame'int'Column type for the tenant foreign key. See Multi-tenancy.
key_types.attachablesame'int'Column type for the model that uses a file.

Disk ​

KeyTypeDefaultWhat it does
diskstringenv('MEDIA_LIBRARY_DISK', env('MEDIA_DISK', 'public'))The disk that holds originals.
conversions_diskstring or nullnullA separate disk for thumbnails and conversions. null keeps them with the original.
temporary_url_minutesint30Lifetime of temporary URLs (S3) and signed streaming links (local) for files on a private disk.
route_prefixstring'media-library'URL prefix for the upload, download and serve routes.

See Storage & S3.

Upload ​

KeyTypeDefaultWhat it does
upload.max_file_sizeint (kilobytes)512 * 1024Largest file, 512 MB by default. 0 removes the limit.
upload.chunk_sizeint (bytes)5 * 1024 * 1024Size of each chunk the browser sends. The server never accepts a value under 256 KB.
upload.max_parallel_uploadsint3Files the browser uploads at the same time.
upload.accepted_mime_typesarrayimages, video, audio, PDF, ZIP, text, CSV, Office documentsMIME patterns the library accepts. image/* style wildcards work.
upload.blocked_extensionsarrayscripts, executables, html, xml, js and similarExtensions that are always refused, whatever the MIME type says.
upload.sanitize_svgbooltrueStrip scripts and unsafe markup from SVG uploads.
upload.preserve_file_namesboolfalseKeep the original file name on disk instead of a generated one.
upload.duplicatesDuplicateStrategyDuplicateStrategy::AskWhat happens when a file matches an existing one by hash. Ask, Allow or UseExisting.
upload.url_importbooltrueAllow importing files from a URL. The url_import feature overrides it.
upload.chunk_directorystring'media-library-chunks'Folder under storage/app for unfinished chunks.

See Uploading and Security.

Conversions ​

conversions is an array keyed by conversion name. The defaults:

php
'conversions' => [
    'thumb' => ['width' => 480, 'height' => 480, 'fit' => 'crop', 'format' => 'webp', 'queued' => false],
    'preview' => ['width' => 1600, 'height' => 1600, 'fit' => 'contain', 'format' => 'webp', 'queued' => true, 'responsive' => true, 'optimize' => true],
],
OptionTypeWhat it does
width, heightintTarget size in pixels.
fitstringcrop, contain and the other Spatie fit modes. Cropped conversions follow the focal point.
formatstringOutput format, for example webp.
queuedboolGenerate on the queue. thumb is synchronous so new uploads appear at once.
responsiveboolGenerate responsive image variants.
optimizeboolRun Spatie's image optimizers. Slow, so queue it.

Add your own names to use them with <x-media-library-image> and the table columns.

Versions ​

KeyTypeDefaultWhat it does
versions.enabledbooltrueKeep the previous file when you replace or save an edit as a new version.
versions.keepint10Versions kept per file. Older ones are pruned.

Tenancy ​

KeyTypeDefaultWhat it does
tenancy.enabledboolfalseScope the library to a tenant outside panels. Panels with tenancy do this on their own.
tenancy.resolverclass-stringFilamentTenantResolver::classThe class that returns the current tenant. StanclTenantResolver ships with the package.
tenancy.strictbooltrueShow nothing when no tenant resolves.

See Multi-tenancy.

Private media ​

KeyTypeDefaultWhat it does
private_mediabooltrueLet uploaders mark files and folders private. Private records are visible to their owner and to users who pass viewPrivate.

See Private files and Authorization.

Quota ​

KeyTypeDefaultWhat it does
quotaint, null or invokable class-stringnullMaximum bytes per tenant, or for the whole app without tenancy. An invokable class receives the current tenant and returns bytes or null.

Trash ​

KeyTypeDefaultWhat it does
trash.enabledbooltrueMove deleted files to the trash. When off, deleting removes the file for good.
trash.prune_after_daysint30Age at which media-library:prune removes trashed files.

Alt text ​

KeyTypeDefaultWhat it does
alt_text.generatorclass-stringNullAltTextGenerator::classClass that writes alt text. Use AnthropicAltTextGenerator::class for Claude, or your own AltTextGenerator.
alt_text.auto_generateboolfalseDescribe every new image on the queue.
alt_text.anthropic.api_keystringenv('ANTHROPIC_API_KEY')API key for AnthropicAltTextGenerator.
alt_text.anthropic.modelstringenv('MEDIA_LIBRARY_ALT_TEXT_MODEL', 'claude-opus-5-5')Model used for descriptions.

See AI alt text.

Browser ​

KeyTypeDefaultWhat it does
browser.per_pageint48Items loaded per page.
browser.default_layout'grid' or 'list''grid'Starting layout.
browser.default_sortstring'newest'Starting sort: newest, oldest, name_asc, name_desc, largest, smallest.
browser.tile_sizeint180Grid tile size in pixels. The plugin clamps it between 120 and 280.

Features ​

Each key switches one part of the library on or off. null keeps the default, which is on. The four keys that default to null also honour their older config key (trash.enabled, private_media, versions.enabled, upload.url_import).

KeyDefault
features.folders, tags, favoritestrue
features.trashnull
features.private_medianull
features.versionsnull
features.image_editor, focal_pointtrue
features.url_importnull
features.folder_upload, alt_text, duplicate, download, exif, usage, smart_views, keyboard_shortcutstrue

The plugin lists what each flag turns off.

Standalone ​

KeyTypeDefaultWhat it does
standalone.enabledboolfalseAllow the picker and library on your own Livewire and Blade pages. When off, the standalone routes return 404.
standalone.middlewarearray['web', 'auth']Middleware for the standalone upload and download routes.

Read Outside Filament panels before you turn this on. The default policy lets every signed-in user manage shared media, so register your own policy first on a site with customer accounts.

Commercial licence. One licence per production project. Terms · Privacy · Refunds