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.

Pros

  • Link selected images to your models using a string path to their file.
  • Easy to integrate with existing projects that already have their own media library structure.
  • Image conversions built with Glide, Cloudflare Images & Bunny.net Dynamic Image Processing.
  • Support any file type.

Cons

  • No PDF/video-previews built-in.
  • Authorization required to ensure that used images are not deleted.
  • No duplicate file handling (if allowed to upload preserving name).
  • No built-in ability to store metadata (like alt-text).

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');
    })

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

© FilamentPlugins.com ✦ 2022 – 2025 ✦ All rights reserved.