laravel-composite-key icon indicating copy to clipboard operation
laravel-composite-key copied to clipboard

Current version of laravel-composit-key not compatible with laravel SoftDeletes

Open HighCoData opened this issue 6 years ago • 0 comments

If you have a Model that uses both HasCompositeKey and SoftDeletes you get an error while trying to delete a record:

"array_key_exists(): The first argument should be either a string or an integer"; "Illuminate/Database/Eloquent/Concerns/HasAttributes.php", "line": 311

This is caused by the line: $query = $this->newQueryWithoutScopes()->where($this->getKeyName(), $this->getKey()); Illuminate/Database/Eloquent/SoftDeletes.php on line 63.

This type of query does not take into account the primary key value.

HighCoData avatar Mar 25 '18 17:03 HighCoData