@@ 59-72 (lines=14) @@ | ||
56 | }); |
|
57 | } |
|
58 | ||
59 | public function fields(): Collection |
|
60 | { |
|
61 | $fieldsParameter = config('query-builder.parameters.fields'); |
|
62 | ||
63 | $fieldsPerTable = collect($this->getPartsOfRequest($fieldsParameter)); |
|
64 | ||
65 | if ($fieldsPerTable->isEmpty()) { |
|
66 | return collect(); |
|
67 | } |
|
68 | ||
69 | return $fieldsPerTable->map(function ($fields) { |
|
70 | return explode(',', $fields); |
|
71 | }); |
|
72 | } |
|
73 | ||
74 | /** |
|
75 | * @return array|string|null |
@@ 98-110 (lines=13) @@ | ||
95 | }); |
|
96 | ||
97 | /* @deprecated */ |
|
98 | Request::macro('fields', function (): Collection { |
|
99 | $fieldsParameter = config('query-builder.parameters.fields'); |
|
100 | ||
101 | $fieldsPerTable = collect($this->query($fieldsParameter)); |
|
102 | ||
103 | if ($fieldsPerTable->isEmpty()) { |
|
104 | return collect(); |
|
105 | } |
|
106 | ||
107 | return $fieldsPerTable->map(function ($fields) { |
|
108 | return explode(',', $fields); |
|
109 | }); |
|
110 | }); |
|
111 | ||
112 | /* @deprecated */ |
|
113 | Request::macro('sort', function ($default = null) { |