Skip to content

Commit 8130b05

Browse files
committed
Fix SelectMultipleFilter::toQueryParam when passing a string
1 parent f111749 commit 8130b05

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Filters/SelectMultipleFilter.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Code16\Sharp\Filters;
44

5+
use Illuminate\Support\Arr;
6+
57
abstract class SelectMultipleFilter extends SelectFilter
68
{
79
public function fromQueryParam($value): array
@@ -13,8 +15,10 @@ public function fromQueryParam($value): array
1315

1416
public function toQueryParam($value): ?string
1517
{
16-
return $value && count($value)
17-
? collect($value)->implode(',')
18+
$values = Arr::wrap($value);
19+
20+
return count($values)
21+
? implode(',', $values)
1822
: null;
1923
}
2024
}

0 commit comments

Comments
 (0)