van-ons/filament-attachment-library
Filament Attachment Library adds a simple attachments manager to your Filament panel: upload files, browse and select existing attachments, and store them in a central library. Includes installer command, migrations/assets, and Tailwind-ready templates.
When registering the Filament plugin, you can change the path attachments are stored in by using the basePath() method on the FilamentAttachmentLibrary instance.
You can either pass a string or a closure that returns a string.
For example, you can set it to use the current tenant's slug:
<?php
namespace App\Providers\Filament;
use VanOns\FilamentAttachmentLibrary\FilamentAttachmentLibrary;
use Filament\Facades\Filament;
class ExamplePanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->tenant(...)
->plugin(
FilamentAttachmentLibrary::make()
->basePath(fn () => 'tenants/' . Filament::getTenant()?->slug)
);
}
}
How can I help you explore Laravel packages today?