8000 Merge tag 'v0.10.3' into develop · Naxon/laravel-json-api@292bab8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 292bab8

Browse files
committed
Merge tag 'v0.10.3' into develop
Fix qualified sorting parameters in Eloquent adapter.
2 parents d16e0ff + b5a37e0 commit 292bab8

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

CHANGELOG.md

< 10000 span class="sr-only">Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ All notable changes to this project will be documented in this file. This projec
88
- Client supplied ids will now be hydrated into Eloquent models, configurable via the `$clientId` property
99
on the Eloquent hydrator.
1010

11+
## [0.10.3] - 2017-09-02
12+
13+
### Fixed
14+
-[#96] Fixed creation of qualified sorting parameters in the Eloquent adapter.
15+
1116
## [0.10.2] - 2017-08-25
1217

1318
### Added

src/Store/EloquentAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ protected function getQualifiedSortColumn(Builder $query, $field)
364364
{
365365
$key = $this->columnForField($field, $query->getModel());
366366

367-
if (!str_contains('.', $key)) {
367+
if (!str_contains($key, '.')) {
368368
$key = sprintf('%s.%s', $query->getModel()->getTable(), $key);
369369
}
370370

tests/Integration/Eloquent/PostsTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ class PostsTest extends TestCase
1313
*/
1414
protected $resourceType = 'posts';
1515

16+
public function testSearch()
17+
{
18+
factory(Post::class, 3)->create();
19+
20+
$this->doSearch(['sort' => '-created-at'])->assertSearchResponse();
21+
}
22+
1623
/**
1724
* Test that we can search posts for specific ids
1825
*/

0 commit comments

Comments
 (0)
0