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
                }
@@ 386-399 (lines=14) @@
383
                        $keyword
384
                    );
385
                }
386
            } else {
387
                if (count(explode('.', $column)) > 1) {
388
                    $eagerLoads     = $this->getEagerLoads();
389
                    $parts          = explode('.', $column);
390
                    $relationColumn = array_pop($parts);
391
                    $relation       = implode('.', $parts);
392
                    if (in_array($relation, $eagerLoads)) {
393
                        $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
394
                    }
395
                }
396
397
                $keyword = $this->getSearchKeyword($index);
398
                $this->compileColumnSearch($index, $column, $keyword);
399
            }
400
401
            $this->isFilterApplied = true;
402
        }