getUser()), Stat::make('Customers', $this->getCustomerCount()), Stat::make('Paid Users', $this->getUserPaid()), Stat::make('Logs Count', $this->getLogsCount()), Stat::make('Total Mailbox', $this->getTotalMailbox()), Stat::make('Emails Received', $this->getTotalEmailsReceived()), Stat::make('Emails Stored', $this->getStoreEmailsCount()), Stat::make('Open Tickets', $this->getOpenTicketsCount()), Stat::make('Closed Tickets', $this->getClosedTicketsCount()), ]; } private function getUser(): int { return User::all()->count(); } private function getUserPaid(): int { return DB::table('subscriptions') ->where(['stripe_status' => 'active']) ->distinct('user_id') ->count('user_id'); } private function getLogsCount(): int { return Log::all()->count(); } private function getTotalMailbox(): int { return Meta::select('value')->where(['key' => 'email_ids_created'])->first()->value; } private function getTotalEmailsReceived(): int { return Meta::select('value')->where(['key' => 'messages_received'])->first()->value; } private function getCustomerCount(): int { return User::whereNotNull('stripe_id')->count(); } private function getStoreEmailsCount(): int { return PremiumEmail::all()->count(); } private function getOpenTicketsCount(): int { return Ticket::whereIn('status', ['open', 'pending'])->count(); } private function getClosedTicketsCount(): int { return Ticket::whereIn('status', ['closed'])->count(); } }