@@ 44-59 (lines=16) @@ | ||
41 | return collect($appendParts)->filter(); |
|
42 | } |
|
43 | ||
44 | public function filters(): Collection |
|
45 | { |
|
46 | $filterParameterName = config('query-builder.parameters.filter'); |
|
47 | ||
48 | $filterParts = $this->query($filterParameterName, []); |
|
49 | ||
50 | if (is_string($filterParts)) { |
|
51 | return collect(); |
|
52 | } |
|
53 | ||
54 | $filters = collect($filterParts); |
|
55 | ||
56 | return $filters->map(function ($value) { |
|
57 | return $this->getFilterValue($value); |
|
58 | }); |
|
59 | } |
|
60 | ||
61 | public function fields(): Collection |
|
62 | { |
|
@@ 61-74 (lines=14) @@ | ||
58 | }); |
|
59 | } |
|
60 | ||
61 | public function fields(): Collection |
|
62 | { |
|
63 | $fieldsParameterName = config('query-builder.parameters.fields'); |
|
64 | ||
65 | $fieldsPerTable = collect($this->query($fieldsParameterName)); |
|
66 | ||
67 | if ($fieldsPerTable->isEmpty()) { |
|
68 | return collect(); |
|
69 | } |
|
70 | ||
71 | return $fieldsPerTable->map(function ($fields) { |
|
72 | return explode(',', $fields); |
|
73 | }); |
|
74 | } |
|
75 | ||
76 | public function sorts(): Collection |
|
77 | { |