json([ 'data' => [ 'organisations' => [ 'total' => Organisation::withoutGlobalScopes()->count(), 'by_billing_status' => Organisation::withoutGlobalScopes() ->selectRaw('billing_status, COUNT(*) as count') ->groupBy('billing_status') ->pluck('count', 'billing_status'), ], 'events' => [ 'total' => Event::withoutGlobalScopes()->count(), 'by_status' => Event::withoutGlobalScopes() ->selectRaw('status, COUNT(*) as count') ->groupBy('status') ->pluck('count', 'status'), ], 'users' => [ 'total' => User::count(), 'verified' => User::whereNotNull('email_verified_at')->count(), ], 'persons' => [ 'total' => Person::withoutGlobalScopes()->count(), ], ], ]); } }