diff --git a/CHANGELOG.md b/CHANGELOG.md index 73c49eed..0a2f5cee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `laravel-query-builder` will be documented in this file +## 2.8.2 - 2020-05-25 + +- fix scope filters that are added via macros (e.g. `onlyTrashed`) (#469) + ## 2.8.1 - 2020-03-20 - make service provider deferrable (#381) diff --git a/tests/FiltersTrashedTest.php b/tests/FiltersTrashedTest.php index 376f372d..45e64ad0 100644 --- a/tests/FiltersTrashedTest.php +++ b/tests/FiltersTrashedTest.php @@ -46,6 +46,19 @@ public function it_can_filter_only_trashed() $this->assertCount(1, $models); } + /** @test */ + public function it_can_filter_only_trashed_by_scope_directly() + { + $models = $this + ->createQueryFromFilterRequest([ + 'only_trashed' => true + ]) + ->allowedFilters(AllowedFilter::scope('only_trashed')) + ->get(); + + $this->assertCount(1, $models); + } + /** @test */ public function it_can_filter_with_trashed() {