File tree Expand file tree Collapse file tree
src/Query/Scopes/Filters/Fields Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,10 +20,12 @@ public function fieldItems()
2020 'default ' => 'like ' ,
2121 ],
2222 'term ' => [
23- 'type ' => 'select ' ,
24- 'options ' => $ this ->options ()->all (),
23+ 'type ' => 'terms ' ,
2524 'placeholder ' => __ ('Term ' ),
2625 'clearable ' => true ,
26+ 'mode ' => 'select ' ,
27+ 'max_items ' => 1 ,
28+ 'taxonomies ' => $ this ->fieldtype ->taxonomies (),
2729 'if ' => [
2830 'operator ' => 'contains_any like ' ,
2931 ],
@@ -63,21 +65,4 @@ public function badge($values)
6365
6466 return $ field .': ' .$ term ;
6567 }
66-
67- protected function options ()
68- {
69- return collect ($ this ->fieldtype ->taxonomies ())
70- ->map (function ($ handle ) {
71- return Facades \Taxonomy::find ($ handle );
72- })
73- ->filter ()
74- ->flatMap (function ($ taxonomy ) {
75- return $ taxonomy ->queryTerms ()->get ();
76- })
77- ->mapWithKeys (function ($ term ) {
78- $ value = $ this ->fieldtype ->usingSingleTaxonomy () ? $ term ->slug () : $ term ->id ();
79-
80- return [$ value => $ term ->title ()];
81- });
82- }
8368}
You can’t perform that action at this time.
0 commit comments