@extends('layout.backend') @section('title', 'Regiões') @section('scripts') @parent @vite(['resources/js/common-index.js']) @endsection @section('content') {!! Form::hidden('currentRoute', route('regions.index'), ['id' => 'currentRoute']) !!} {{-- Ações --}} @include('components.widget.alerts') {{-- FILTROS --}} {{-- CORPO --}} @foreach($regions as $region) {{-- Cabeçalho: nome + cor --}} {{ $region->name }} {{-- Membros --}} Membros @can('edit-users') {{ $region->usershlc->count() }} Colih {{ $region->userspvg->count() }} GVP {{ $region->usersassistant->count() }} Assist. @endcan @can('view-easers') {{ $region->easers->count() }} Facilit. @endcan {{-- Território e Estrutura --}} Território @can('edit-users') {{ $region->cities->count() }} Cidades @endcan @can('view-users') {{ $region->congregations->count() }} Congreg. @endcan @can('view-doctor') @php($medCount = App\Models\Doctor::inCooperators()->whereHas('addresses', fn($q) => $q->where('region_id', $region->id))->count()) {{ $medCount }} Méd. @endcan @can('view-hospitals') @php($cntHosp = $region->hospitals()->TypeHospital()->where('region_id',$region->id)->count()) @php($cntEsc = $region->hospitals()->TypeSchool()->where('region_id',$region->id)->count()) @php($cntHE = $region->hospitals()->TypeHospitalSchool()->where('region_id',$region->id)->count()) @php($cntOther = $region->hospitals()->TypeOther()->where('region_id',$region->id)->count()) {{ $cntHosp }} Hosp. {{ $cntEsc }} Escola @if($cntHE > 0) {{ $cntHE }} H+E @endif @if($cntOther > 0) {{ $cntOther }} Outros @endif @endcan {{-- WhatsApp --}} Grupos @if($region->whatsapp_group_hlc) Colih @endif @if($region->whatsapp_group_gvp) GVP @endif @if(!$region->whatsapp_group_hlc && !$region->whatsapp_group_gvp) Nenhum grupo configurado @endif {{-- AÇÕES --}} @can('edit-users') @endcan @can('delete-users') @endcan @endforeach {{-- DELETE MODAL --}} @endsection