File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,13 @@ public function get($columns = ['*'])
194194 });
195195 }
196196
197+ public function pluck ($ column , $ key = null )
198+ {
199+ $ this ->applyCollectionAndTaxonomyWheres ();
200+
201+ return parent ::pluck ($ column , $ key );
202+ }
203+
197204 public function count ()
198205 {
199206 $ this ->applyCollectionAndTaxonomyWheres ();
Original file line number Diff line number Diff line change @@ -105,4 +105,16 @@ public function it_build_stache_associations_when_taxonomy_driver_is_not_eloquen
105105
106106 $ this ->assertCount (2 , $ taxonomyStore ->store ('test ' )->index ('associations ' )->items ());
107107 }
108+
109+ #[Test]
110+ public function it_applies_taxonomy_wheres_using_pluck_count_and_get ()
111+ {
112+ $ taxonomy = tap (Taxonomy::make ('test ' )->title ('test ' ))->save ();
113+
114+ $ term = tap (TermFacade::make ('test-term ' )->taxonomy ('test ' )->data ([]))->save ();
115+
116+ $ this ->assertSame (1 , $ taxonomy ->queryTerms ()->pluck ('slug ' )->unique ()->count ());
117+ $ this ->assertSame (1 , $ taxonomy ->queryTerms ()->count ());
118+ $ this ->assertSame ($ term ->slug (), $ taxonomy ->queryTerms ()->get ()->pluck ('slug ' )->first ());
119+ }
108120}
You can’t perform that action at this time.
0 commit comments