Askedio/laravel-soft-cascade

Cannot delete relation with composite keys

Closed this issue · 1 comments

Meshz commented

Hello,

First of all, thank you for this package. I'm getting an error when I try to soft delete a relation that has a composite keys. I'm using this trait for composite keys.

The returned error is: "stripos() expects parameter 1 to be string, array given". That's because in my model my primary key looks like: protected $primaryKey = [ 'column1', 'column2' ];. Therefore it isn't a string but an array.

Any idea on how to resolve this? Thanks for your feedback!

Eloquent doesn't support composite primary keys and our package neither do we.

The only option that I can give you is that you create a fork of our package and add that functionality. When we go making changes you can do a rebase, resolve conflicts and get the changes that we apply.

Sorry for the inconvenience.