File Manager for Laravel Filament

Secure storage-area browsing, previews, uploads, and picker fields for private documents, public media, S3-compatible disks, and Spatie Media Library workflows.

UniFileManager file manager interface showing folders and files

Install

Install the Filament package and allow Composer to update the shared core package.

composer require unifilemanager/filament-file-manager:^0.8 -W
php artisan optimize:clear

Register the Filament plugin

use UniFileManager\FilamentFileManager\FilamentFileManagerPlugin;

$panel
    ->plugin(FilamentFileManagerPlugin::make());

Compatibility

Laravel Filament Livewire PHP
11.x4.x, 5.x3.x, 4.x8.2+
12.x4.x, 5.x3.x, 4.x8.2+
13.x4.x, 5.x3.x, 4.x8.2+

Storage Areas

Storage areas define trusted server-side disks, roots, and visibility. Use private areas for documents and public areas only for media that can safely expose URLs.

Private documents

Invoices, contracts, imports, exports, and customer files.

Public media

Website images, profile media, and other files intended for public URLs.

Custom areas

Named areas for tenant roots, product images, avatars, or application-specific libraries.

'storage_areas' => [
    'public' => [
        'enabled' => true,
        'disk' => 'public',
        'root' => 'file-manager/public',
        'visibility' => 'public',
    ],
],

UniFilePicker

Use `UniFilePicker` in Filament forms to select existing files, upload directly, restrict MIME types, and target a specific storage area.

use UniFileManager\FilamentFileManager\Filament\Forms\Components\UniFilePicker;

UniFilePicker::make('document')
    ->privateMedia()
    ->acceptedFileTypes(['application/pdf']);
UniFilePicker::make('hero_image')
    ->storageArea('public');
UniFilePicker::make('attachments')
    ->multiple()
    ->maxFiles(10);

Spatie Media Library

Sync selected File Manager files into Spatie Media Library collections while keeping the original file-manager objects intact.

composer require spatie/laravel-medialibrary
UniFilePicker::make('gallery')
    ->multiple()
    ->storageArea('public')
    ->collection('gallery');
The model must implement Spatie's `HasMedia` contract. Removing a picker selection removes the media row from the collection, but does not delete the underlying file.

When a storage area uses a root prefix, configure your Spatie path generator to honour the media row's `external_dir` custom property.

Uploads and Previews

Uploaded files keep safe client filenames. Existing files are never overwritten; collisions become `filename (2).ext`, then `filename (3).ext`.

Previews

Preview images, PDFs, and text files from inside the File Manager.

Thumbnails

Supported images receive thumbnails. Other files use clear file-type tiles.

Public URLs

Public media areas can expose copyable URLs for files intended to be public.

S3, R2, and MinIO

UniFileManager supports S3-compatible disks and Laravel Vapor temporary upload streams.

'storage_areas' => [
    'private' => [
        'enabled' => true,
        'disk' => 's3',
        'root' => 'file-manager/private',
        'visibility' => 'private',
    ],
],

`unifilemanager/core` v0.1.4 optimizes object-store directory listings by using Flysystem listing metadata instead of extra metadata calls per entry.

Multi Tenancy

Tenant-aware applications can return trusted tenant-specific disk and root configuration through a storage-area resolver.

'storage_area_resolver' => App\Support\TenantStorageAreaResolver::class,

Never trust browser-supplied disks or roots. Storage area definitions should come from server-side configuration or trusted tenant state.

Configuration

Publish configuration when you need to customize areas, authorization, picker defaults, previews, uploads, or navigation.

php artisan vendor:publish --tag=filament-file-manager-config
FilamentFileManagerPlugin::make()
    ->navigationLabel('Files')
    ->navigationIcon('heroicon-o-folder')
    ->navigationSort(20);

Security Model

  • Directory traversal is rejected.
  • Dot-prefixed files and directories are hidden.
  • The configured storage root cannot be renamed, moved, or deleted.
  • Picker selections are revalidated on the server before persistence.
  • Public URLs should be enabled only for public media areas.

Upgrade

composer require unifilemanager/filament-file-manager:^0.8 -W
php artisan filament:assets
php artisan optimize:clear

If you published package views, compare them with the latest package views before upgrading.

Release Notes

v0.8.0

  • Added `UniFilePicker::storageArea()`.
  • Added optional Spatie Media Library collection syncing with `UniFilePicker::collection()`.
  • Updated styling to inherit Filament panel colors and modal elevation tokens.
  • Added stable Livewire keys for File Manager grid items and File Picker cards.
  • Requires `unifilemanager/core` v0.1.4 or later.

Thanks to @FaizAhmadSE for contributing the original picker, media-library, and theme-aware UI implementation work.