From a7386814c7a8a799868f5c41f7e09d1f97621946 Mon Sep 17 00:00:00 2001 From: "Harry (hjbdev)" Date: Tue, 8 Apr 2025 17:54:33 +0100 Subject: [PATCH] counts on the dashboard --- .../Controllers/OrganisationController.php | 2 + resources/js/pages/organisations/Show.vue | 72 +++++++++++++++---- resources/js/types/index.d.ts | 2 +- routes/web.php | 3 +- 4 files changed, 65 insertions(+), 14 deletions(-) diff --git a/app/Http/Controllers/OrganisationController.php b/app/Http/Controllers/OrganisationController.php index cd08ecb..bca7630 100644 --- a/app/Http/Controllers/OrganisationController.php +++ b/app/Http/Controllers/OrganisationController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Models\Organisation; use App\Models\Provider; use Illuminate\Http\Request; use Inertia\Inertia; @@ -12,6 +13,7 @@ class OrganisationController extends Controller { return inertia('organisations/Show', [ 'providers' => Inertia::lazy(fn () => Provider::whereOrganisationId($request->route('organisation'))->get()), + 'organisation' => Organisation::withCount('servers', 'applications', 'members')->findOrFail($request->route('organisation')), ]); } } diff --git a/resources/js/pages/organisations/Show.vue b/resources/js/pages/organisations/Show.vue index a1a0375..1858c89 100644 --- a/resources/js/pages/organisations/Show.vue +++ b/resources/js/pages/organisations/Show.vue @@ -1,7 +1,9 @@