Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…database-extension.git

Conflicts:
	changelog.md
  • Loading branch information
forxer committed Mar 4, 2020
2 parents 6a67090 + c2fdf5e commit 18b1cd2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -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)
------------------

Expand Down
6 changes: 5 additions & 1 deletion src/Eloquent/SoftDeletes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
});
}
Expand Down

0 comments on commit 18b1cd2

Please sign in to comment.