Code Duplication    Length = 14-18 lines in 2 locations

src/Engines/QueryBuilderEngine.php 2 locations

@@ 129-146 (lines=18) @@
126
                    $callback($builder, $keyword);
127
                    $query->addNestedWhereQuery($builder, 'or');
128
                } else {
129
                    if (count(explode('.', $columnName)) > 1) {
130
                        $eagerLoads     = $this->getEagerLoads();
131
                        $parts          = explode('.', $columnName);
132
                        $relationColumn = array_pop($parts);
133
                        $relation       = implode('.', $parts);
134
                        if (in_array($relation, $eagerLoads)) {
135
                            $this->compileRelationSearch(
136
                                $query,
137
                                $relation,
138
                                $relationColumn,
139
                                $keyword
140
                            );
141
                        } else {
142
                            $this->compileQuerySearch($query, $columnName, $keyword);
143
                        }
144
                    } else {
145
                        $this->compileQuerySearch($query, $columnName, $keyword);
146
                    }
147
                }
148
149
                $this->isFilterApplied = true;
@@ 663-676 (lines=14) @@
660
                $builder  = $this->query->newQuery();
661
                $callback($builder, $keyword);
662
                $this->query->addNestedWhereQuery($builder);
663
            } else {
664
                if (count(explode('.', $column)) > 1) {
665
                    $eagerLoads     = $this->getEagerLoads();
666
                    $parts          = explode('.', $column);
667
                    $relationColumn = array_pop($parts);
668
                    $relation       = implode('.', $parts);
669
                    if (in_array($relation, $eagerLoads)) {
670
                        $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
671
                    }
672
                }
673
674
                $keyword = $this->getColumnSearchKeyword($index);
675
                $this->compileColumnSearch($index, $column, $keyword);
676
            }
677
678
            $this->isFilterApplied = true;
679
        }