@extends('admin.layout') @section('title', 'Profielattributen') @section('content') @php $barMax = fn($collection, string $field) => max(1, $collection->max($field)); @endphp
{{-- Totals --}}
@foreach([ ['label' => __('Diagnoses'), 'key' => 'diagnoses', 'color' => '#6366f1'], ['label' => __('Strengths'), 'key' => 'strengths', 'color' => '#22c55e'], ['label' => __('Challenges'), 'key' => 'challenges', 'color' => '#f97316'], ['label' => __('Purposes'), 'key' => 'purposes', 'color' => '#8b5cf6'], ['label' => __('Interests'), 'key' => 'interests', 'color' => '#14b8a6'], ] as $item)

{{ $item['label'] }}

{{ number_format($totals[$item['key']]) }}

@endforeach
{{-- Charts grid --}}
{{-- Diagnoses --}}

{{ __('Top diagnoses') }}

@php $m = $barMax($diagnoses, 'total'); @endphp
@foreach($diagnoses as $item)
{{ $item->diagnosis }} {{ number_format($item->total) }}
@endforeach
{{-- Strengths --}}

{{ __('Top strengths') }}

@php $m = $barMax($strengths, 'total'); @endphp
@foreach($strengths as $item)
{{ $item->strength }} {{ number_format($item->total) }}
@endforeach
{{-- Challenges --}}

{{ __('Top challenges') }}

@php $m = $barMax($challenges, 'total'); @endphp
@foreach($challenges as $item)
{{ $item->challenge }} {{ number_format($item->total) }}
@endforeach
{{-- Interests --}}

{{ __('Top interests') }}

@php $m = $barMax($topInterests, 'total'); @endphp
@foreach($topInterests as $item)
{{ $item->name_nl }} {{ number_format($item->total) }}
@endforeach
{{-- Purposes + Looking for --}}

{{ __('Connection purposes') }}

@php $m = $barMax($purposes, 'total'); @endphp
@foreach($purposes as $item)
{{ $item->purpose }} {{ number_format($item->total) }}
@endforeach

{{ __('Looking for') }}

@php $m = $barMax($lookingFor, 'total'); @endphp
@foreach($lookingFor as $item)
{{ $item->gender }} {{ number_format($item->total) }}
@endforeach
@endsection