mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 12:29:29 +01:00
Re-use query instead of calling it again
This commit is contained in:
parent
56739b6150
commit
598e3e1401
@ -27,11 +27,12 @@ class ListPlugins extends ListRecords
|
|||||||
];
|
];
|
||||||
|
|
||||||
foreach (PluginCategory::cases() as $category) {
|
foreach (PluginCategory::cases() as $category) {
|
||||||
|
$query = Plugin::whereCategory($category->value);
|
||||||
$tabs[$category->value] = Tab::make($category->value)
|
$tabs[$category->value] = Tab::make($category->value)
|
||||||
->label($category->getLabel())
|
->label($category->getLabel())
|
||||||
->icon($category->getIcon())
|
->icon($category->getIcon())
|
||||||
->badge(Plugin::whereCategory($category->value)->count())
|
->badge($query->count())
|
||||||
->modifyQueryUsing(fn ($query) => $query->whereCategory($category->value));
|
->modifyQueryUsing(fn () => $query);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tabs;
|
return $tabs;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user