|
@@ -151,8 +151,7 @@ discard block |
|
|
block discarded – undo |
|
151
|
151
|
throw new ModelNotDefinedInAggregatorException(); |
|
152
|
152
|
} |
|
153
|
153
|
|
|
154
|
|
- return method_exists($this->model, 'toSearchableArray') ? $this->model->toSearchableArray() : |
|
155
|
|
- $this->model->toArray(); |
|
|
154
|
+ return method_exists($this->model, 'toSearchableArray') ? $this->model->toSearchableArray() : $this->model->toArray(); |
|
156
|
155
|
} |
|
157
|
156
|
|
|
158
|
157
|
/** |
|
@@ -168,10 +167,10 @@ discard block |
|
|
block discarded – undo |
|
168
|
167
|
$softDeletes = |
|
169
|
168
|
in_array(SoftDeletes::class, class_uses_recursive($model)) && config('scout.soft_delete', false); |
|
170
|
169
|
|
|
171
|
|
- $instance->newQuery()->when($softDeletes, function ($query) { |
|
|
170
|
+ $instance->newQuery()->when($softDeletes, function($query) { |
|
172
|
171
|
$query->withTrashed(); |
|
173
|
|
- })->orderBy($instance->getKeyName())->chunk(config('scout.chunk.searchable', 500), function ($models) { |
|
174
|
|
- $models = $models->filter->shouldBeSearchable()->map(function ($model) { |
|
|
172
|
+ })->orderBy($instance->getKeyName())->chunk(config('scout.chunk.searchable', 500), function($models) { |
|
|
173
|
+ $models = $models->filter->shouldBeSearchable()->map(function($model) { |
|
175
|
174
|
return static::create($model); |
|
176
|
175
|
}); |
|
177
|
176
|
|
|
@@ -209,7 +208,7 @@ discard block |
|
|
block discarded – undo |
|
209
|
208
|
$softDeletes = |
|
210
|
209
|
in_array(SoftDeletes::class, class_uses_recursive($model), true) && config('scout.soft_delete', false); |
|
211
|
210
|
|
|
212
|
|
- $count += $model::query()->when($softDeletes, function ($query) { |
|
|
211
|
+ $count += $model::query()->when($softDeletes, function($query) { |
|
213
|
212
|
$query->withTrashed(); |
|
214
|
213
|
})->count(); |
|
215
|
214
|
} |