Skip to content

Commit

Permalink
Merge pull request #89 from ametad/check-if-softdeletes
Browse files Browse the repository at this point in the history
Use soft delete only when available and configured to use
  • Loading branch information
matchish authored Mar 3, 2020
2 parents f2cf4d7 + f0eaeca commit 04422b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/)

## [Unreleased]

## [3.0.1] - 2020-03-02
### Fixed
- Respect the model uses soft delete

## [3.0.0] - 2019-11-17
### Added
- Elasticsearch 7 support
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "matchish/laravel-scout-elasticsearch",
"description": "Search among multiple models with ElasticSearch and Laravel Scout",
"version": "3.0.0",
"version": "3.0.1",
"keywords": [
"laravel",
"scout",
Expand Down
2 changes: 1 addition & 1 deletion src/Searchable/DefaultImportSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private function model()
private function newQuery()
{
$query = $this->model()->newQuery();
$softDelete = config('scout.soft_delete', false);
$softDelete = $this->className::usesSoftDelete() && config('scout.soft_delete', false);
$query
->when($softDelete, function ($query) {
return $query->withTrashed();
Expand Down

0 comments on commit 04422b9

Please sign in to comment.