Askedio / laravel-soft-cascade

Cascade Delete & Restore when using Laravel SoftDeletes
https://medium.com/asked-io/cascading-softdeletes-with-laravel-5-a1a9335a5b4d
MIT License
705 stars 63 forks source link

Set 'update' as a default action if action is null. #116

Closed om3rcitak closed 4 years ago

om3rcitak commented 4 years ago

Now, I can't use only relation name in $softCascade variable. If a set $softCascade variable as a like this;

in Post model protected $softCascade = ['comments'];

I get this exception;

Askedio/SoftCascade/Exceptions/SoftCascadeLogicException with message 'Non existing relation action [comments@]'

So, I added 'update' action as a default action if action is null. Now, I can use $softCascade variable elements without action.