Code Duplication    Length = 14-20 lines in 2 locations

src/Engines/QueryBuilderEngine.php 2 locations

@@ 178-197 (lines=20) @@
175
                                $globalKeyword
176
                            );
177
                        }
178
                    } else {
179
                        if (count(explode('.', $columnName)) > 1) {
180
                            $eagerLoads     = $this->getEagerLoads();
181
                            $parts          = explode('.', $columnName);
182
                            $relationColumn = array_pop($parts);
183
                            $relation       = implode('.', $parts);
184
                            if (in_array($relation, $eagerLoads)) {
185
                                $this->compileRelationSearch(
186
                                    $queryBuilder,
187
                                    $relation,
188
                                    $relationColumn,
189
                                    $globalKeyword
190
                                );
191
                            } else {
192
                                $this->compileQuerySearch($queryBuilder, $columnName, $globalKeyword);
193
                            }
194
                        } else {
195
                            $this->compileQuerySearch($queryBuilder, $columnName, $globalKeyword);
196
                        }
197
                    }
198
199
                    $this->isFilterApplied = true;
200
                }
@@ 385-398 (lines=14) @@
382
                        $keyword
383
                    );
384
                }
385
            } else {
386
                if (count(explode('.', $column)) > 1) {
387
                    $eagerLoads     = $this->getEagerLoads();
388
                    $parts          = explode('.', $column);
389
                    $relationColumn = array_pop($parts);
390
                    $relation       = implode('.', $parts);
391
                    if (in_array($relation, $eagerLoads)) {
392
                        $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
393
                    }
394
                }
395
396
                $keyword = $this->getSearchKeyword($index);
397
                $this->compileColumnSearch($index, $column, $keyword);
398
            }
399
400
            $this->isFilterApplied = true;
401
        }