Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Filament Attachment Library

Filament Attachment Library Laravel Package

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.

View on GitHub
Deep Wiki
Context7

A Filament library for attaching files to Eloquent models.

Frequently asked questions about Filament Attachment Library
How do I install Filament Attachment Library in a Laravel project with Filament v4 or v5?
Run `composer require van-ons/filament-attachment-library:^2.0` to install the package, then execute `php artisan filament-attachment-library:install` to set up migrations and assets. Ensure you have Filament v4 or v5 installed, as this package is version-locked to those.
Does this package support S3 or other cloud storage backends for attachments?
Yes, the package leverages Laravel’s built-in storage system, so you can configure it to use S3, local storage, or any other supported backend via Laravel’s filesystem configuration. No additional setup is required beyond your existing storage configuration.
Can I customize the UI of the attachment manager to match my Filament theme?
The package uses Tailwind CSS for styling, so you can override or extend its styles by creating a custom Filament theme. Add the provided CSS snippets to your `theme.css` file, and the attachment manager will adapt to your theme’s design.
What Laravel and Filament versions does this package support?
The package requires Laravel 8.0+ and is compatible with Filament v4 and v5. Version 2.x explicitly targets Filament 4.0+ and 5.0+, while version 1.x supports older Filament versions. Always check the compatibility table in the README for exact version requirements.
How do I add attachments to an Eloquent model?
Use the `HasAttachments` trait on your Eloquent model and define a `attachments()` relationship method. The package will automatically handle the pivot table or morphable attachments. Example: `use HasAttachments; public function attachments() { return $this->morphMany(Attachment::class, 'attachable'); }`
Will this package work with Filament v6 when it’s released?
Currently, the package is tightly coupled to Filament v4/v5 and does not officially support v6. If Filament v6 introduces breaking changes, you may need to wait for an updated version of this package or consider alternatives. Monitor the GitHub repository for announcements.
Are there performance concerns with large-scale attachments (e.g., thousands per model)?
The package does not include built-in optimizations for large-scale attachments, such as background processing or chunked uploads. For high-volume use cases, consider implementing Laravel queues for processing or optimizing your storage backend (e.g., S3 with lifecycle policies).
How do I migrate existing attachments from another system to this library?
Manually create records in the `attachments` table (or your custom pivot table) for each file, ensuring the `attachable_id` and `attachable_type` fields match your Eloquent models. Use Laravel’s model events or a data migration script to automate the process if needed.
Does this package provide API endpoints to fetch attachments programmatically?
No, the package is UI-focused and integrates directly with Filament’s admin panel. For API access, you’ll need to create custom routes or use Laravel’s built-in file responses. The package provides methods like `getUrl()` to generate secure attachment URLs for frontend or API use.
I’m using a custom storage disk for attachments. How do I configure it?
Configure your custom disk in Laravel’s `filesystems.php` under the `disks` array, then set the `default` or `attachments` disk in the package’s config file (published via `php artisan vendor:publish`). The package will automatically use the configured disk for all uploads and storage operations.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
cocosmos/filament-sticky-save-bar
patrickbussmann/oauth2-apple
3brs/enterprise-security-bundle
anousss007/vigilance
supportpal/eloquent-model
ardenexal/fhir-models
laravel-at/laravel-image-sanitize
romalytar/yammi-audit-log-laravel
ardenexal/fhir-validation
arshaviras/weather-widget
laravel-chronicle/core
sunchayn/nimbus
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope