@@ -71,11 +71,11 @@ |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $searchables = $searchable->getScoutModelsByIds($builder, |
74 | - collect($results['hits'])->pluck('objectID')->values()->all())->keyBy(function ($searchable) { |
|
74 | + collect($results['hits'])->pluck('objectID')->values()->all())->keyBy(function($searchable) { |
|
75 | 75 | return $searchable->getScoutKey(); |
76 | 76 | })->map->getModel(); |
77 | 77 | |
78 | - return Collection::make($results['hits'])->map(function ($hit) use ($searchables) { |
|
78 | + return Collection::make($results['hits'])->map(function($hit) use ($searchables) { |
|
79 | 79 | if (isset($searchables[$hit['objectID']])) { |
80 | 80 | return $searchables[$hit['objectID']]; |
81 | 81 | } |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | $softDeletes = in_array(SoftDeletes::class, class_uses_recursive($model)) && config('scout.soft_delete', |
181 | 181 | false); |
182 | 182 | |
183 | - $instance->newQuery()->when($softDeletes, function ($query) { |
|
183 | + $instance->newQuery()->when($softDeletes, function($query) { |
|
184 | 184 | $query->withTrashed(); |
185 | - })->orderBy($instance->getKeyName())->get()->map(function ($model) { |
|
185 | + })->orderBy($instance->getKeyName())->get()->map(function($model) { |
|
186 | 186 | return static::create($model); |
187 | 187 | })->searchable(); |
188 | 188 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | foreach ((new static)->getModels() as $model) { |
199 | 199 | $instance = new $model; |
200 | 200 | |
201 | - $instance->newQuery()->orderBy($instance->getKeyName())->get()->map(function ($model) { |
|
201 | + $instance->newQuery()->orderBy($instance->getKeyName())->get()->map(function($model) { |
|
202 | 202 | return static::create($model); |
203 | 203 | })->unsearchable(); |
204 | 204 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $softDeletes = in_array(SoftDeletes::class, class_uses_recursive($model), |
216 | 216 | true) && config('scout.soft_delete', false); |
217 | 217 | |
218 | - $count += $model::query()->when($softDeletes, function ($query) { |
|
218 | + $count += $model::query()->when($softDeletes, function($query) { |
|
219 | 219 | $query->withTrashed(); |
220 | 220 | })->count(); |
221 | 221 | } |