This package provides attachment management using a polymorphic morphMany relationship within Filament. The system allows for the seamless association of attachments with various models, enabling flexible and efficient handling of file attachments across your application.
You can install the package via composer:
composer require zeeshantariq/filament-attachmate
The package comes with publishable assets:
Migrations
php artisan vendor:publish --tag="filament-attachmate-migrations"
php artisan make:model MyModel
use ZeeshanTariq\FilamentAttachmate\Core\InteractsWithAttachments;// ... class MyModel extends Model{ use InteractsWithAttachments; // ...}
form
Filament resource declaration you need to add AttachmentFileUpload::make()
so your users can upload the attachments.use ZeeshanTariq\FilamentAttachmate\Forms\Components\AttachmentFileUpload; public static function form(Form $form): Form{ return $form ->schema([ // ... AttachmentFileUpload::make(), ]);}
CreateRecord component
use ZeeshanTariq\FilamentAttachmate\Core\HandleAttachments; class CreateMyModel extends CreateRecord{ use HandleAttachments; // ...}
EditRecord component
use ZeeshanTariq\FilamentAttachmate\Core\HandleAttachments; class EditMyModel extends EditRecord{ use HandleAttachments; // ...}
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.