laravel-composite-key
laravel-composite-key copied to clipboard
Current version of laravel-composit-key not compatible with laravel SoftDeletes
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.