documents as $docs) { if ($docs->is_close_due != 0) { $count += 1; } } } return inertia('Dashboard', [ 'count_active' => $count, 'count_update' => Document::whereDate('due_date', '<=', now()->toDateString())->count(), ]); } }