| @@ 73-86 (lines=14) @@ | ||
| 70 | }); |
|
| 71 | } |
|
| 72 | ||
| 73 | public function fields(): Collection |
|
| 74 | { |
|
| 75 | $fieldsParameterName = config('query-builder.parameters.fields'); |
|
| 76 | ||
| 77 | $fieldsPerTable = collect($this->query($fieldsParameterName)); |
|
| 78 | ||
| 79 | if ($fieldsPerTable->isEmpty()) { |
|
| 80 | return collect(); |
|
| 81 | } |
|
| 82 | ||
| 83 | return $fieldsPerTable->map(function ($fields) { |
|
| 84 | return explode(static::getArrayValueDelimiter(), $fields); |
|
| 85 | }); |
|
| 86 | } |
|
| 87 | ||
| 88 | public function sorts(): Collection |
|
| 89 | { |
|
| @@ 88-99 (lines=12) @@ | ||
| 85 | }); |
|
| 86 | } |
|
| 87 | ||
| 88 | public function sorts(): Collection |
|
| 89 | { |
|
| 90 | $sortParameterName = config('query-builder.parameters.sort'); |
|
| 91 | ||
| 92 | $sortParts = $this->query($sortParameterName); |
|
| 93 | ||
| 94 | if (is_string($sortParts)) { |
|
| 95 | $sortParts = explode(static::getArrayValueDelimiter(), $sortParts); |
|
| 96 | } |
|
| 97 | ||
| 98 | return collect($sortParts)->filter(); |
|
| 99 | } |
|
| 100 | ||
| 101 | /** |
|
| 102 | * @param $value |
|