/** * Get Contract count by status * * @param $statusType * @return array */ public function statusCount($statusType) { return $this->contract->selectRaw(sprintf("contracts.\"%s\" as status, COUNT(*)", $statusType))->groupBy($statusType)->get()->toArray(); }