0) { $active = $this->sessions->countActiveForUser($userId); if ($active >= $activeLimit) { throw new RuntimeException('Upload limit reached.'); } } $dailyLimit = (int) config('uploads.quotas.max_daily_sessions', 0); if ($dailyLimit > 0) { $since = CarbonImmutable::now()->startOfDay(); $daily = $this->sessions->countForUserSince($userId, $since); if ($daily >= $dailyLimit) { throw new RuntimeException('Daily upload limit reached.'); } } } }