Code Duplication    Length = 14-18 lines in 2 locations

src/Engines/QueryBuilderEngine.php 2 locations

@@ 171-188 (lines=18) @@
168
                    $callback($builder, $keyword);
169
                    $query->addNestedWhereQuery($builder, 'or');
170
                } else {
171
                    if (count(explode('.', $columnName)) > 1) {
172
                        $eagerLoads     = $this->getEagerLoads();
173
                        $parts          = explode('.', $columnName);
174
                        $relationColumn = array_pop($parts);
175
                        $relation       = implode('.', $parts);
176
                        if (in_array($relation, $eagerLoads)) {
177
                            $this->compileRelationSearch(
178
                                $query,
179
                                $relation,
180
                                $relationColumn,
181
                                $keyword
182
                            );
183
                        } else {
184
                            $this->compileQuerySearch($query, $columnName, $keyword);
185
                        }
186
                    } else {
187
                        $this->compileQuerySearch($query, $columnName, $keyword);
188
                    }
189
                }
190
191
                $this->isFilterApplied = true;
@@ 451-464 (lines=14) @@
448
                $builder  = $this->query->newQuery();
449
                $callback($builder, $keyword);
450
                $this->query->addNestedWhereQuery($builder);
451
            } else {
452
                if (count(explode('.', $column)) > 1) {
453
                    $eagerLoads     = $this->getEagerLoads();
454
                    $parts          = explode('.', $column);
455
                    $relationColumn = array_pop($parts);
456
                    $relation       = implode('.', $parts);
457
                    if (in_array($relation, $eagerLoads)) {
458
                        $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
459
                    }
460
                }
461
462
                $keyword = $this->getColumnSearchKeyword($index);
463
                $this->compileColumnSearch($index, $column, $keyword);
464
            }
465
466
            $this->isFilterApplied = true;
467
        }