please tell me how can I improve the database query in Laravel?
there are two methods in the repository
public function getCountAdverts(): array
{
return [
Advert::STATUS_PUBLISHED => $this->getCount(Advert::STATUS_PUBLISHED),
Advert::STATUS_CLOSED => $this->getCount(Advert::STATUS_CLOSED),
Advert::STATUS_NOT_PUBLISHED => $this->getCount(Advert::STATUS_NOT_PUBLISHED),
Advert::STATUS_MODERATION => $this->getCount(Advert::STATUS_MODERATION),
];
}
private function getCount(string $status): int
{
return Advert::where('status', $status)->count();
}
How can I get the same array without just 4 queries?

