Skip to content

Commit 2737b22

Browse files
Add test for scope filter fix
1 parent b3fba93 commit 2737b22

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

CHANGELOG.md

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

33
All notable changes to `laravel-query-builder` will be documented in this file
44

5+
## 2.8.2 - 2020-05-25
6+
7+
- fix scope filters that are added via macros (e.g. `onlyTrashed`) (#469)
8+
59
## 2.8.1 - 2020-03-20
610

711
- make service provider deferrable (#381)

tests/FiltersTrashedTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ public function it_can_filter_only_trashed()
4646
$this->assertCount(1, $models);
4747
}
4848

49+
/** @test */
50+
public function it_can_filter_only_trashed_by_scope_directly()
51+
{
52+
$models = $this
53+
->createQueryFromFilterRequest([
54+
'only_trashed' => true
55+
])
56+
->allowedFilters(AllowedFilter::scope('only_trashed'))
57+
->get();
58+
59+
$this->assertCount(1, $models);
60+
}
61+
4962
/** @test */
5063
public function it_can_filter_with_trashed()
5164
{

0 commit comments

Comments
 (0)