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
                }
@@ 465-478 (lines=14) @@
462
                        $keyword
463
                    );
464
                }
465
            } else {
466
                if (count(explode('.', $column)) > 1) {
467
                    $eagerLoads     = $this->getEagerLoads();
468
                    $parts          = explode('.', $column);
469
                    $relationColumn = array_pop($parts);
470
                    $relation       = implode('.', $parts);
471
                    if (in_array($relation, $eagerLoads)) {
472
                        $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
473
                    }
474
                }
475
476
                $keyword = $this->getSearchKeyword($index);
477
                $this->compileColumnSearch($index, $column, $keyword);
478
            }
479
480
            $this->isFilterApplied = true;
481
        }