Download the PHP package martinpetricko/filament-restore-or-create without Composer
On this page you can find all versions of the php package martinpetricko/filament-restore-or-create. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download martinpetricko/filament-restore-or-create
More information about martinpetricko/filament-restore-or-create
Files in martinpetricko/filament-restore-or-create
Package filament-restore-or-create
Short Description FilamentPHP package that adds ability to check for similar deleted records and restore them instead of creating new ones.
License MIT
Homepage https://github.com/martinpetricko/filament-restore-or-create
Informations about the package filament-restore-or-create
Filament Restore or Create
Restore or Create is a FilamentPHP plugin that helps prevent duplicate records by detecting and restoring soft-deleted models when similar data is submitted via a create form.
Features
- Detects similar soft-deleted records before creating a new one.
- Displays a modal with details and an option to restore the deleted record.
- Fully customizable detection, display, and behavior logic.
Installation
Install via Composer:
Optionally, publish the translation files:
Usage
Add CheckDeleted
trait to your resource's CreateRecord
page:
Customization
Attributes to check
Define which fields should be used to detect similar deleted records:
Custom Query Logic
Override the default query to define your own matching logic:
Modal Display Fields
Choose which attributes to show in the confirmation modal:
Restore Notification
Customize the notification shown after a record is restored:
Redirect After Restore
Control where the user is redirected after restoring:
Advanced Integration
If you override beforeCreate
, ensure the restore behavior is still called:
Testing
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Martin Petricko
- All Contributors
License
The MIT License (MIT). Please see License File for more information.