@@ -175,9 +175,9 @@ discard block |
||
175 | 175 | |
176 | 176 | $softDeletes = in_array(SoftDeletes::class, class_uses_recursive($model)) && config('scout.soft_delete', false); |
177 | 177 | |
178 | - $instance->newQuery()->when($softDeletes, function ($query) { |
|
178 | + $instance->newQuery()->when($softDeletes, function($query) { |
|
179 | 179 | $query->withTrashed(); |
180 | - })->orderBy($instance->getKeyName())->get()->map(function ($model) { |
|
180 | + })->orderBy($instance->getKeyName())->get()->map(function($model) { |
|
181 | 181 | return static::create($model); |
182 | 182 | })->searchable(); |
183 | 183 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | foreach ((new static)->getModels() as $model) { |
194 | 194 | $instance = new $model; |
195 | 195 | |
196 | - $instance->newQuery()->orderBy($instance->getKeyName())->get()->map(function ($model) { |
|
196 | + $instance->newQuery()->orderBy($instance->getKeyName())->get()->map(function($model) { |
|
197 | 197 | return static::create($model); |
198 | 198 | })->unsearchable(); |
199 | 199 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | foreach ($this->getModels() as $model) { |
210 | 210 | $softDeletes = in_array(SoftDeletes::class, class_uses_recursive($model), true) && config('scout.soft_delete', false); |
211 | 211 | |
212 | - $count += (int) $model::query()->when($softDeletes, function ($query) { |
|
212 | + $count += (int) $model::query()->when($softDeletes, function($query) { |
|
213 | 213 | $query->withTrashed(); |
214 | 214 | })->count(); |
215 | 215 | } |