dcat/laravel-softdeletes
dcat/laravel-softdeletes adds enhanced soft delete support to Laravel Eloquent models. Cascade deletes and restores across related records, keep data consistent, and avoid unique constraint conflicts from trashed rows, all through simple traits with minimal configuration.
dcat/laravel-softdeletes brings Laravel's soft delete behavior to pivot models in many-to-many relationships. Detaching a related record no longer removes the pivot row permanently—it keeps a deleted_at timestamp, preserving history and allowing later restoration.
Just add the package trait to your pivot model and keep using familiar attach, detach, and sync calls. Detached rows become trashed automatically and can be queried, restored, or force-deleted like any soft-deletable model.
deleted_at on detach.withTrashedPivot, onlyTrashedPivot).How can I help you explore Laravel packages today?