mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-08 10:39:27 +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) {
|
||||
$query = Plugin::whereCategory($category->value);
|
||||
$tabs[$category->value] = Tab::make($category->value)
|
||||
->label($category->getLabel())
|
||||
->icon($category->getIcon())
|
||||
->badge(Plugin::whereCategory($category->value)->count())
|
||||
->modifyQueryUsing(fn ($query) => $query->whereCategory($category->value));
|
||||
->badge($query->count())
|
||||
->modifyQueryUsing(fn () => $query);
|
||||
}
|
||||
|
||||
return $tabs;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user