Code Duplication    Length = 14-20 lines in 2 locations

src/Engines/QueryBuilderEngine.php 2 locations

@@ 179-198 (lines=20) @@
176
                                $globalKeyword
177
                            );
178
                        }
179
                    } else {
180
                        if (count(explode('.', $columnName)) > 1) {
181
                            $eagerLoads     = $this->getEagerLoads();
182
                            $parts          = explode('.', $columnName);
183
                            $relationColumn = array_pop($parts);
184
                            $relation       = implode('.', $parts);
185
                            if (in_array($relation, $eagerLoads)) {
186
                                $this->compileRelationSearch(
187
                                    $queryBuilder,
188
                                    $relation,
189
                                    $relationColumn,
190
                                    $globalKeyword
191
                                );
192
                            } else {
193
                                $this->compileQuerySearch($queryBuilder, $columnName, $globalKeyword);
194
                            }
195
                        } else {
196
                            $this->compileQuerySearch($queryBuilder, $columnName, $globalKeyword);
197
                        }
198
                    }
199
200
                    $this->isFilterApplied = true;
201
                }
@@ 490-503 (lines=14) @@
487
                        $keyword
488
                    );
489
                }
490
            } else {
491
                if (count(explode('.', $column)) > 1) {
492
                    $eagerLoads     = $this->getEagerLoads();
493
                    $parts          = explode('.', $column);
494
                    $relationColumn = array_pop($parts);
495
                    $relation       = implode('.', $parts);
496
                    if (in_array($relation, $eagerLoads)) {
497
                        $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
498
                    }
499
                }
500
501
                $keyword = $this->getSearchKeyword($index);
502
                $this->compileColumnSearch($index, $column, $keyword);
503
            }
504
505
            $this->isFilterApplied = true;
506
        }