Code Duplication    Length = 9-10 lines in 2 locations

src/Engines/QueryBuilderEngine.php 2 locations

@@ 325-333 (lines=9) @@
322
                    );
323
                }
324
            } else {
325
                if (count(explode('.', $column)) > 1) {
326
                    $eagerLoads     = $this->getEagerLoads();
327
                    $parts          = explode('.', $column);
328
                    $relationColumn = array_pop($parts);
329
                    $relation       = implode('.', $parts);
330
                    if (in_array($relation, $eagerLoads)) {
331
                        $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
332
                    }
333
                }
334
335
                $column          = $this->castColumn($column);
336
                $keyword         = $this->getSearchKeyword($index);
@@ 437-446 (lines=10) @@
434
                    $orderable['direction']
435
                );
436
            } else {
437
                if (count(explode('.', $column)) > 1) {
438
                    $eagerLoads     = $this->getEagerLoads();
439
                    $parts          = explode('.', $column);
440
                    $relationColumn = array_pop($parts);
441
                    $relation       = implode('.', $parts);
442
443
                    if (in_array($relation, $eagerLoads)) {
444
                        $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
445
                    }
446
                }
447
448
                $this->getQueryBuilder()->orderBy($column, $orderable['direction']);
449
            }