@extends('layouts.admin') @section('title', 'Organization Hierarchy') @section('page-title', 'Organization Structure') @section('page-subtitle', 'Manage branches from headquarters to lower branches') @section('content')
@if(session('success'))
{{ session('success') }}
@endif

Organization Hierarchy

View and manage your church organization structure

Add Branch

Organization Tree

View Full Hierarchy
@if($headquarters)
@if($headquarters->logo) @else
@endif

{{ $headquarters->name }}

HEADQUARTERS
{{ $headquarters->members()->count() }} members {{ $headquarters->branches()->count() }} branches
@if($headquarters->branches->count() > 0)
@foreach($headquarters->branches as $branch)
@if($branch->branches->count() > 0)
@endif
{{ $branch->name }}
{{ $branch->type }}
{{ $branch->members()->count() }} {{ $branch->location ?? 'N/A' }}
Edit
@csrf @method('DELETE')
@if($branch->branches->count() > 0)
@foreach($branch->branches as $subBranch)
{{ $subBranch->name }}

{{ $subBranch->members()->count() }} members

@csrf @method('DELETE')
@endforeach
@endif
@endforeach
@else

No branches added yet. Create your first branch!

Add Branch
@endif
@else

No Organization Setup

Create your headquarters to start building your organization.

Create Headquarters
@endif

Quick Stats

{{ $churchCounts['headquarters'] ?? 0 }}

Headquarters

{{ $churchCounts['regions'] ?? 0 }}

Regions

{{ $churchCounts['districts'] ?? 0 }}

Districts

{{ $churchCounts['branches'] ?? 0 }}

Branches

@endsection