Download the PHP package dillingham/soft-deletes-parent without Composer
On this page you can find all versions of the php package dillingham/soft-deletes-parent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dillingham/soft-deletes-parent
More information about dillingham/soft-deletes-parent
Files in dillingham/soft-deletes-parent
Package soft-deletes-parent
Short Description Soft delete children when parent soft deletes
License MIT
Homepage https://github.com/dillingham/soft-deletes-parent
Informations about the package soft-deletes-parent
Laravel Soft Deletes Parent
Automatically soft delete a model's children while maintaining their own soft deleted state when you restore the parent model. After installing the trait below, the Post
model's parent_deleted_at
will update whenever an Author
model is deleted or restored. This allows you to maintain the original deleted_at
for the Post
model after Author
is restored. The Post
model will scope queries to exclude any where the parent is deleted.
Installation
You can install the package via composer:
Usage
Add the parent_deleted_at
column to your table:
And add the trait and parent model to your child model:
Scopes
With parent trashed:
Only parent trashed:
Testing
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Brian Dillingham
- All Contributors
License
The MIT License (MIT). Please see License File for more information.