@extends('layouts.app') @section('title', 'Client Groups Management') @section('content')

{{ \App\Models\ClientGroup::count() }}

Total Groups

{{ \App\Models\ClientGroup::where('status', 'active')->count() }}

Active Groups

{{ \App\Models\Client::where('type', 'group')->count() }}

Group Clients

${{ number_format(\App\Models\ClientGroup::with('activeMembers')->get()->sum(function($group) { return $group->activeMembers->sum(function($client) { return $client->savingsAccounts->sum('current_balance'); }); }), 2) }}

Total Group Savings

@forelse($groups as $group) @empty @endforelse
GROUP CODE GROUP INFORMATION MEMBERS MIN SAVINGS STATUS CREATED ACTIONS
{{ $group->code }}
{{ $group->name }}
{{ \Illuminate\Support\Str::limit($group->description, 50) }}
{{ $group->active_members_count }} members
${{ number_format($group->minimum_savings, 2) }}
@if($group->status == 'active') Active @else Inactive @endif
{{ $group->created_at->format('M d, Y') }}
{{ $group->created_at->diffForHumans() }}

No groups found

Get started by creating your first client group.

@if($groups->hasPages())
Showing {{ $groups->firstItem() }} to {{ $groups->lastItem() }} of {{ $groups->total() }} groups
{{ $groups->links() }}
@endif
@endsection