muhammadkazimsadiq / filament-quick-edit
Filament plugin to quick-edit/add table rows using modals and filtering form fields.
Package info
github.com/MuhammadKazimSadiq/filament-quick-edit
pkg:composer/muhammadkazimsadiq/filament-quick-edit
Fund package maintenance!
Requires
- php: ^8.2
- filament/filament: ^5.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.7|^4.0
- pestphp/pest-plugin-arch: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
- pestphp/pest-plugin-livewire: ^3.0|^4.0
README
Filament plugin to help users quickly add or edit records using modals by dynamically filtering the actual resource form fields. Sometimes forms are very long; this plugin lets you take a subset of the fields for quick actions.
Installation
You can install the package via composer:
composer require muhammadkazimsadiq/filament-quick-edit
You can publish the translation files using:
php artisan vendor:publish --tag="filament-quick-edit-translations"
Usage
You can use the QuickAddAction in your page headers or table header actions, and the QuickEditAction in your table row actions.
The plugin provides three dedicated modifier methods:
->selectFields(array $fields): Only keep the specified fields in the quick form.->excludeFields(array $fields): Exclude the specified fields from the quick form.->onlyRequiredFields(bool $condition = true): Automatically extract only the fields marked as required in the resource.
Quick Edit Action
Use QuickEditAction::make() inside a Filament Table to quickly edit a record with limited fields:
use MuhammadKazimSadiq\FilamentQuickEdit\Actions\QuickEditAction; public function table(Table $table): Table { return $table ->columns([ // ... ]) ->actions([ QuickEditAction::make() ->selectFields(['name', 'description']), // Or only required fields: // QuickEditAction::make()->onlyRequiredFields(), ]); }
Quick Add Action
Use QuickAddAction::make() in a Filament Page header action or a Table header action to quickly add a new record using the modal:
use MuhammadKazimSadiq\FilamentQuickEdit\Actions\QuickAddAction; protected function getHeaderActions(): array { return [ QuickAddAction::make() ->onlyRequiredFields() ->excludeFields(['status']), ]; }
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.