@@ -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 += $model::query()->when($softDeletes, function ($query) { |
|
| 212 | + $count += $model::query()->when($softDeletes, function($query) { |
|
| 213 | 213 | $query->withTrashed(); |
| 214 | 214 | })->count(); |
| 215 | 215 | } |
@@ -30,11 +30,11 @@ |
||
| 30 | 30 | |
| 31 | 31 | $models = $model->getScoutModelsByIds( |
| 32 | 32 | $builder, collect($results['hits'])->pluck('objectID')->values()->all() |
| 33 | - )->keyBy(function ($model) { |
|
| 33 | + )->keyBy(function($model) { |
|
| 34 | 34 | return $model->getScoutKey(); |
| 35 | 35 | })->map->getModel(); |
| 36 | 36 | |
| 37 | - return collect($results['hits'])->map(function ($hit) use ($models) { |
|
| 37 | + return collect($results['hits'])->map(function($hit) use ($models) { |
|
| 38 | 38 | if (isset($models[$hit['objectID']])) { |
| 39 | 39 | return $models[$hit['objectID']]; |
| 40 | 40 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | foreach ($searchableModelsFinder->fromCommand($this) as $searchable) { |
| 51 | 51 | $this->output->text(' |