diff --git a/changelog.md b/changelog.md index f32421e..1d9ac39 100644 --- a/changelog.md +++ b/changelog.md @@ -1,11 +1,17 @@ Changelog ========= -2.4.0 (2020-03-04) +2.5.0 (2020-03-04) ------------------ - Add support for Laravel 7 +2.4.0 (2020-01-31) +------------------ + +- Support array for except id in softDelete trait +- Replace getKeyName() by getQualifiedKeyName() in softDelete trait + 2.3.0 (2019-12-29) ------------------ diff --git a/src/Eloquent/SoftDeletes.php b/src/Eloquent/SoftDeletes.php index fc1fe82..d9205a2 100644 --- a/src/Eloquent/SoftDeletes.php +++ b/src/Eloquent/SoftDeletes.php @@ -21,7 +21,11 @@ public function scopeWithoutTrashedExcept($query, $exceptId = null) $query->where(function() use ($query, $exceptId){ $query->withoutTrashed(); $query->when($exceptId, function($query, $exceptId){ - $query->orWhere($this->getKeyName(), $exceptId); + if (is_array($exceptId)) { + $query->orWhereIn($this->getQualifiedKeyName(), $exceptId); + } else { + $query->orWhere($this->getQualifiedKeyName(), $exceptId); + } }); }); }