@@ -149,8 +149,7 @@ discard block |
||
149 | 149 | throw new ModelNotDefinedInAggregatorException(); |
150 | 150 | } |
151 | 151 | |
152 | - return method_exists($this->model, 'toSearchableArray') ? $this->model->toSearchableArray() : |
|
153 | - $this->model->toArray(); |
|
152 | + return method_exists($this->model, 'toSearchableArray') ? $this->model->toSearchableArray() : $this->model->toArray(); |
|
154 | 153 | } |
155 | 154 | |
156 | 155 | /** |
@@ -166,10 +165,10 @@ discard block |
||
166 | 165 | $softDeletes = |
167 | 166 | in_array(SoftDeletes::class, class_uses_recursive($model)) && config('scout.soft_delete', false); |
168 | 167 | |
169 | - $instance->newQuery()->when($softDeletes, function ($query) { |
|
168 | + $instance->newQuery()->when($softDeletes, function($query) { |
|
170 | 169 | $query->withTrashed(); |
171 | - })->orderBy($instance->getKeyName())->chunk(config('scout.chunk.searchable', 500), function ($models) { |
|
172 | - $models->map(function ($model) { |
|
170 | + })->orderBy($instance->getKeyName())->chunk(config('scout.chunk.searchable', 500), function($models) { |
|
171 | + $models->map(function($model) { |
|
173 | 172 | return static::create($model); |
174 | 173 | })->filter->shouldBeSearchable()->searchable(); |
175 | 174 | }); |
@@ -187,7 +186,7 @@ discard block |
||
187 | 186 | $softDeletes = |
188 | 187 | in_array(SoftDeletes::class, class_uses_recursive($model), true) && config('scout.soft_delete', false); |
189 | 188 | |
190 | - $count += $model::query()->when($softDeletes, function ($query) { |
|
189 | + $count += $model::query()->when($softDeletes, function($query) { |
|
191 | 190 | $query->withTrashed(); |
192 | 191 | })->count(); |
193 | 192 | } |