Code Duplication    Length = 12-14 lines in 2 locations

src/QueryBuilderRequest.php 2 locations

@@ 59-72 (lines=14) @@
56
        return collect($appendParts)->filter();
57
    }
58
59
    public function fields(): Collection
60
    {
61
        $fieldsParameterName = config('query-builder.parameters.fields');
62
63
        $fieldsPerTable = collect($this->query($fieldsParameterName));
64
65
        if ($fieldsPerTable->isEmpty()) {
66
            return collect();
67
        }
68
69
        return $fieldsPerTable->map(function ($fields) {
70
            return explode(static::getFieldsArrayValueDelimiter(), $fields);
71
        });
72
    }
73
74
    public function sorts(): Collection
75
    {
@@ 74-85 (lines=12) @@
71
        });
72
    }
73
74
    public function sorts(): Collection
75
    {
76
        $sortParameterName = config('query-builder.parameters.sort');
77
78
        $sortParts = $this->query($sortParameterName);
79
80
        if (is_string($sortParts)) {
81
            $sortParts = explode(static::getSortsArrayValueDelimiter(), $sortParts);
82
        }
83
84
        return collect($sortParts)->filter();
85
    }
86
87
    public function filters(): Collection
88
    {