Filament Plugins

Purchase

Storage/disk driver

The FilesystemStorageDriver allows you to let the Media Library run on top of any Laravel filesystem disk. This works both for disks that already have data, as well as entirely empty disks. The Media Library works interchangeably with any other disk operations, thus zero configuration is needed.

Installation

1

Configure driver

To use the FilesystemStorageDriver, make sure you have configured the Laravel Filesystem storage disk that you want to use.

Next, register the driver as follows:

app/Providers/Filament/YourPanelProvider.php
use RalphJSmit\Filament\MediaLibrary\Drivers\FilesystemStorageDriver;

$plugin
    ->driver(FilesystemStorageDriver::class)
2

Review disk

By default, the FilesystemStorageDriver uses the public disk. It is recommended to verify the disk before storing any media:

app/Providers/Filament/YourPanelProvider.php
$plugin
    ->driver(FilesystemStorageDriver::class, function (FilesystemStorageDriver $driver) {
        return $driver->disk('s3');
    })
3

Review directory

In addition to the disk, you can also specify a directory within the disk:

app/Providers/Filament/YourPanelProvider.php
$plugin
    ->driver(FilesystemStorageDriver::class, function (FilesystemStorageDriver $driver) {
        return $driver->disk('s3')->directory('media');
    })

You can override the maximum upload file size for this driver using the ->maxFileSizeKb() method:

app/Providers/Filament/YourPanelProvider.php
$driver->maxFileSizeKb(25 * 1024) // 25 MB

By default, the limit is derived from Livewire's temporary upload rules. If no Livewire rule is configured, it falls back to 12 MB.

That's it! You now have a fully functional Media Library running on your filesystem storage disk as a driver.

© FilamentPlugins.com ✦ 2022 – 2026
PrivacyTerms & Conditions
All rights reserved.