Code Duplication    Length = 14-20 lines in 2 locations

src/Engines/QueryBuilderEngine.php 2 locations

@@ 164-183 (lines=20) @@
161
                                $globalKeyword
162
                            );
163
                        }
164
                    } else {
165
                        if (count(explode('.', $columnName)) > 1) {
166
                            $eagerLoads     = $this->getEagerLoads();
167
                            $parts          = explode('.', $columnName);
168
                            $relationColumn = array_pop($parts);
169
                            $relation       = implode('.', $parts);
170
                            if (in_array($relation, $eagerLoads)) {
171
                                $this->compileRelationSearch(
172
                                    $queryBuilder,
173
                                    $relation,
174
                                    $relationColumn,
175
                                    $globalKeyword
176
                                );
177
                            } else {
178
                                $this->compileQuerySearch($queryBuilder, $columnName, $globalKeyword);
179
                            }
180
                        } else {
181
                            $this->compileQuerySearch($queryBuilder, $columnName, $globalKeyword);
182
                        }
183
                    }
184
185
                    $this->isFilterApplied = true;
186
                }
@@ 367-380 (lines=14) @@
364
                        $keyword
365
                    );
366
                }
367
            } else {
368
                if (count(explode('.', $column)) > 1) {
369
                    $eagerLoads     = $this->getEagerLoads();
370
                    $parts          = explode('.', $column);
371
                    $relationColumn = array_pop($parts);
372
                    $relation       = implode('.', $parts);
373
                    if (in_array($relation, $eagerLoads)) {
374
                        $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
375
                    }
376
                }
377
378
                $keyword = $this->getSearchKeyword($index);
379
                $this->compileColumnSearch($index, $column, $keyword);
380
            }
381
382
            $this->isFilterApplied = true;
383
        }