Plugins
Attachmate
Manage attachments with polymorphic relationship.
Form Builder
Form Field
Dark theme support
Yes
Multi language support
No
Compatible with the latest version
Supported versions: 2.x - 3.x
Documentation

Latest Version on Packagist Total Downloads License

Filament Attachmate

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.

Filament Attachmate

#Installation

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"

#Configuration

  1. Create your model
php artisan make:model MyModel
  1. Configure your model to handle morphMany attachments
use ZeeshanTariq\FilamentAttachmate\Core\InteractsWithAttachments;
// ...
 
class MyModel extends Model
{
use InteractsWithAttachments;
 
// ...
}
  1. Configure the Filament resource
  • In your 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(),
]);
}
  1. Configure the Filament resource The last configuration needed, is to add HandleAttachmets trait to the CreateRecord components of your model

CreateRecord component

use ZeeshanTariq\FilamentAttachmate\Core\HandleAttachments;
 
class CreateMyModel extends CreateRecord
{
use HandleAttachments;
 
// ...
}
  1. Configure the Filament resource The last configuration needed, is to add HandleAttachmets trait to the EditRecord components of your model

EditRecord component

use ZeeshanTariq\FilamentAttachmate\Core\HandleAttachments;
 
class EditMyModel extends EditRecord
{
use HandleAttachments;
 
// ...
}

#Changelog

Please see CHANGELOG for more information on what has changed recently.

#Contributing

Please see CONTRIBUTING for details.

#Credits

#License

The MIT License (MIT). Please see License File for more information.

Zeeshan Tariq
1
Plugins
34
Stars
Featured Plugins