Skip to content

Commit b47cce1

Browse files
demoskpDemos Petsas
andauthored
fix unexpected lowecasing of appends (#637)
Co-authored-by: Demos Petsas <[email protected]>
1 parent 37fc6b3 commit b47cce1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/QueryBuilderRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function appends(): Collection
5454
$appendParts = $this->getRequestData($appendParameterName);
5555

5656
if (! is_array($appendParts)) {
57-
$appendParts = explode(static::getAppendsArrayValueDelimiter(), strtolower($appendParts));
57+
$appendParts = explode(static::getAppendsArrayValueDelimiter(), $appendParts);
5858
}
5959

6060
return collect($appendParts)->filter();

tests/QueryBuilderRequestTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,4 +454,16 @@ public function it_takes_custom_delimiters_for_splitting_request_parameters()
454454

455455
$this->assertEquals($expected, $request->filters()->toArray());
456456
}
457+
458+
/** @test */
459+
public function it_adds_any_appends_as_they_come_from_the_request()
460+
{
461+
$request = new QueryBuilderRequest([
462+
'append' => 'aCamelCaseAppend,anotherappend',
463+
]);
464+
465+
$expected = collect(['aCamelCaseAppend', 'anotherappend']);
466+
467+
$this->assertEquals($expected, $request->appends());
468+
}
457469
}

0 commit comments

Comments
 (0)