Cascading deletes for Eloquent models that implement soft deletes
Add Laravel 5.6 support
Add Laravel 5.5 support
Remove composer.lock
file from package repository
Add Laravel 5.4 compatibility
Add Laravel 5.3 compatibility
Provides better support for hasOne
relationships, and relationship methods that return null
.
Thanks to @schnittstabil, adds support for cascading deletes of model grandchildren per #8, #9.
Per #7, when using forceDelete
in combination with foreign key constraints, the forceDelete
would fail ont he parent record due to child records still existing as the cascade would only ever use delete
, updating the child records' deleted_at
column leaving them in place.
If you happen to want all of your models to implement SoftDeletes
, you can now also add the CascadeSoftDeletes
to your base model and the functionality will be correctly inherited through your child models.
LogicException
is now thrown if the method does not exist, as well as if it does exist and does not implement Illuminate\Database\Eloquent\Relations\Relation
cascadeDeletes
property to a getter method, to ensure the trait functions even without the property definedcollect
to array_filter
(minor speed improvement)cascadeDeletes
property