martinpetricko/filament-restore-or-create
SoftDeletes) may unintentionally be recreated as duplicates. The package bridges the gap between data integrity and UX by preventing accidental duplicates via a restore-first approach.SoftDeletes, Eloquent) and Filament’s form/modal system, ensuring minimal architectural disruption. Works seamlessly with existing Laravel apps using Filament for admin interfaces.SoftDeletes trait.Laravel Scout for full-text search) if default detection (exact field matches) is insufficient.email, sku) for performance.recently_deleted()) or add caching.whereNull('deleted_at') scope)?SoftDeletes.Filament\Forms\Components\TextInput).SoftDeletes and Filament forms are up-to-date.email, reference_number).composer require martinpetricko/filament-restore-or-create
AppServiceProvider:
Filament::registerPlugin(RestoreOrCreatePlugin::make());
use MartinPetricko\FilamentRestoreOrCreate\Concerns\InteractsWithRestoreOrCreate;
class MyResource extends Resource {
use InteractsWithRestoreOrCreate;
}
filament:debug command.email), limit soft-deleted scope (e.g., last 6 months), or use Scout.version column).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Package conflicts with Filament | Form submission breaks | Test in staging; isolate custom logic. |
| Detection logic too strict/loose | False positives/negatives | Customize matchers; add admin overrides. |
| Database timeout on large datasets | Slow UI response | Add indexes; paginate soft-deleted queries. |
| Modal JS errors | Broken UX | Polyfill Filament’s modal system. |
| Concurrent restore conflicts | Data corruption | Use Eloquent’s version column. |
README and Filament’s plugin system docs.How can I help you explore Laravel packages today?