Code Duplication    Length = 14-20 lines in 2 locations

src/Engines/QueryBuilderEngine.php 2 locations

@@ 194-213 (lines=20) @@
191
                                $keyword
192
                            );
193
                        }
194
                    } else {
195
                        if (count(explode('.', $columnName)) > 1) {
196
                            $eagerLoads     = $this->getEagerLoads();
197
                            $parts          = explode('.', $columnName);
198
                            $relationColumn = array_pop($parts);
199
                            $relation       = implode('.', $parts);
200
                            if (in_array($relation, $eagerLoads)) {
201
                                $this->compileRelationSearch(
202
                                    $queryBuilder,
203
                                    $relation,
204
                                    $relationColumn,
205
                                    $keyword
206
                                );
207
                            } else {
208
                                $this->compileQuerySearch($queryBuilder, $columnName, $keyword);
209
                            }
210
                        } else {
211
                            $this->compileQuerySearch($queryBuilder, $columnName, $keyword);
212
                        }
213
                    }
214
215
                    $this->isFilterApplied = true;
216
                }
@@ 514-527 (lines=14) @@
511
                        $keyword
512
                    );
513
                }
514
            } else {
515
                if (count(explode('.', $column)) > 1) {
516
                    $eagerLoads     = $this->getEagerLoads();
517
                    $parts          = explode('.', $column);
518
                    $relationColumn = array_pop($parts);
519
                    $relation       = implode('.', $parts);
520
                    if (in_array($relation, $eagerLoads)) {
521
                        $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
522
                    }
523
                }
524
525
                $keyword = $this->getSearchKeyword($index);
526
                $this->compileColumnSearch($index, $column, $keyword);
527
            }
528
529
            $this->isFilterApplied = true;
530
        }