Commit b8cde029 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix isEmpty() on array — wrap DB::select results in collect()

Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent ea44efee
...@@ -42,10 +42,10 @@ public function render() ...@@ -42,10 +42,10 @@ public function render()
: ($totalSubscriptionRevenue > 0 ? 100 : 0); : ($totalSubscriptionRevenue > 0 ? 100 : 0);
// Revenue by activity // Revenue by activity
$byActivity = $this->getRevenueByActivity($startDate, $academyId); $byActivity = collect($this->getRevenueByActivity($startDate, $academyId));
// Top programs by subscription revenue // Top programs by subscription revenue
$topPrograms = $this->getTopPrograms($startDate, $academyId); $topPrograms = collect($this->getTopPrograms($startDate, $academyId));
// Enrollment counts // Enrollment counts
$newEnrollments = Enrollment::where('created_at', '>=', $startDate) $newEnrollments = Enrollment::where('created_at', '>=', $startDate)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment