@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $observer = tap(resolve(AggregatorObserver::class))->setAggregator(static::class, $models = $self->getModels()); |
60 | 60 | |
61 | 61 | foreach ($models as $model) { |
62 | - \Illuminate\Database\Eloquent\Builder::macro('getScoutKey', function () { |
|
62 | + \Illuminate\Database\Eloquent\Builder::macro('getScoutKey', function() { |
|
63 | 63 | if ($this->model === null) { |
64 | 64 | throw new ModelNotDefinedInAggregatorException(); |
65 | 65 | } |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | |
161 | 161 | $softDeletes = in_array(SoftDeletes::class, class_uses_recursive($model)) && config('scout.soft_delete', false); |
162 | 162 | |
163 | - $instance->newQuery()->when($softDeletes, function ($query) { |
|
163 | + $instance->newQuery()->when($softDeletes, function($query) { |
|
164 | 164 | $query->withTrashed(); |
165 | - })->orderBy($instance->getKeyName())->get()->map(function ($model) { |
|
165 | + })->orderBy($instance->getKeyName())->get()->map(function($model) { |
|
166 | 166 | return (new static)->searchableWith($model); |
167 | 167 | })->searchable(); |
168 | 168 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | foreach ((new static)->getModels() as $model) { |
179 | 179 | $instance = new $model; |
180 | 180 | |
181 | - $instance->newQuery()->orderBy($instance->getKeyName())->get()->map(function ($model) { |
|
181 | + $instance->newQuery()->orderBy($instance->getKeyName())->get()->map(function($model) { |
|
182 | 182 | return (new static)->searchableWith($model); |
183 | 183 | })->unsearchable(); |
184 | 184 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | foreach ($this->getModels() as $model) { |
195 | 195 | $softDeletes = in_array(SoftDeletes::class, class_uses_recursive($model), true) && config('scout.soft_delete', false); |
196 | 196 | |
197 | - $count += $model::query()->when($softDeletes, function ($query) { |
|
197 | + $count += $model::query()->when($softDeletes, function($query) { |
|
198 | 198 | $query->withTrashed(); |
199 | 199 | })->count(); |
200 | 200 | } |