route('app.calendar'); } abort_unless($request->user()->isAccountOwner(), SymfonyResponse::HTTP_FORBIDDEN); $account = $request->user()->account; $totalSocialAccounts = 0; $totalMembers = $account->users()->count(); foreach ($account->workspaces as $workspace) { $totalSocialAccounts += $workspace->socialAccounts()->count(); } return Inertia::render('settings/account/Usage', [ 'usage' => [ 'workspaceCount' => $account->workspaces->count(), 'socialAccountCount' => $totalSocialAccounts, 'memberCount' => $totalMembers, 'creditsUsed' => BillingCycle::for($account)->usedCredits(), 'monthlyCreditsLimit' => BillingCycle::for($account)->creditAllotment(), ], ]); } }