hoceineel/filament-undo-toast
A Laravel Filament package that adds undoable toast notifications, letting users instantly reverse destructive actions like deletes. Customize messages, durations, and actions to make admin workflows safer and more forgiving.
Architecture fit
HasUndoableRelations contract or ->restoreRelations([...])), covering BelongsToMany (with pivot columns), HasMany, HasOne, MorphMany, MorphOne, inserting only missing rows inside the same transaction. That is a meaningful capability jump: it moves the package from "undo a row" to "undo an object graph," which is where most real hard-delete regret lives.Integration feasibility
composer require, one plugin registration, opt-in per action. No queue, no external service, no schema change required for the base feature.Technical risk
->replaceSuccessNotification(), ->restoreRelations(), new contract) means minor bumps can carry behavioural change. Evidence: v0.2.0 flips the default for success-notification replacement, which will visibly change every delete flow on upgrade.SECURITY.md, Dependabot with cooldown, SHA-pinned Actions, leaner dist archive.Key questions
Stack fit
SoftDeletes already covers recovery.SoftDeletes: use soft deletes where recovery is a workflow, use this where the product decision is a genuine hard delete but the operator needs a safety net.Migration path (v0.1 → v0.2.0)
successNotification() / successNotificationTitle() customisations — these are preserved — and any test that asserts on Filament notification content, which may now fail or double-count.->replaceSuccessNotification(false) and per-action closures. Recommendation: default off at the panel level, opt in per action, so the change is deliberate rather than inherited.Compatibility
ON DELETE CASCADE, unique indexes, and any DB triggers before enabling. Verify pivot-column coverage for BelongsToMany on tables with payload columns.Sequencing
restoreRelations on one parent-child pair. Test the collision path deliberately.Maintenance
SECURITY.md, slimmed dist archive. That shortens security review, but does not remove single-maintainer risk; consider a fork-and-patch contingency for a package this close to destructive operations.Support
Scaling
will-change is scoped to animation, no clip-path animation, and the stack no longer collapses on pointer gaps — all signs of performance-conscious implementation. No expected issues at normal admin concurrency.Failure modes
mod+z conflicting with browser/OS bindings, or firing while focus is in a text field. v0.2.0 widened the shortcut's focus scope to checkboxes, radios and buttons — verify it does not fire inside text inputs in your forms.Ramp-up
HasUndoableRelations. The contract is the only piece needing real thought.How can I help you explore Laravel packages today?