We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
options()
1 parent 8dd80b1 commit 309f736Copy full SHA for 309f736
1 file changed
src/Query/Scopes/Filters/Blueprint.php
@@ -14,14 +14,10 @@ public static function title()
14
15
public function fieldItems()
16
{
17
- $options = $this->blueprints()->mapWithKeys(function ($blueprint) {
18
- return [$blueprint->handle() => $blueprint->title()];
19
- })->all();
20
-
21
return [
22
'blueprint' => [
23
'type' => 'select',
24
- 'options' => $options,
+ 'options' => $this->options()->all(),
25
'placeholder' => __('Blueprint'),
26
],
27
];
@@ -46,4 +42,11 @@ public function blueprints()
46
42
47
43
return Collection::findByHandle($this->context['collection'])->entryBlueprints();
48
44
}
45
+
+ protected function options()
+ {
+ return $this->blueprints()->mapWithKeys(function ($blueprint) {
49
+ return [$blueprint->handle() => $blueprint->title()];
50
+ });
51
+ }
52
0 commit comments