Completed
Push — master ( 526e21...018e2d )
by Nuno
03:27
created
src/Searchable/Aggregator.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -149,8 +149,7 @@  discard block
 block discarded – undo
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,9 +165,9 @@  discard block
 block discarded – undo
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())->get()->map(function ($model) {
170
+            })->orderBy($instance->getKeyName())->get()->map(function($model) {
172 171
                 return static::create($model);
173 172
             })->searchable();
174 173
         }
@@ -185,7 +184,7 @@  discard block
 block discarded – undo
185 184
             $softDeletes =
186 185
                 in_array(SoftDeletes::class, class_uses_recursive($model), true) && config('scout.soft_delete', false);
187 186
 
188
-            $count += $model::query()->when($softDeletes, function ($query) {
187
+            $count += $model::query()->when($softDeletes, function($query) {
189 188
                 $query->withTrashed();
190 189
             })->count();
191 190
         }
Please login to merge, or discard this patch.