{{-- resources/views/admin/athletes/_edit_profile.blade.php --}}
Identitas & Kategori
@csrf @method('PUT')

@php $ages = ['U-16', 'U-18', 'U-20', 'Elite', 'Master']; $selectedAges = is_string($athlete->age_category) ? json_decode($athlete->age_category, true) : (is_array($athlete->age_category) ? $athlete->age_category : []); @endphp @foreach($ages as $age) @endforeach
@php $ownedIds = $athlete->performances->pluck('discipline_id')->toArray(); $ownedCatIds = $athlete->performances->pluck('discipline.competition_category_id')->unique()->toArray(); @endphp

@foreach($disciplines->groupBy('competition_category_id') as $catId => $catDisciplines) @php $category = $catDisciplines->first()->category; if(!$category) continue; $isCatChecked = in_array($category->id, $ownedCatIds); @endphp

Pilih Nomor Spesialisasi:

@foreach($catDisciplines as $disc) @php $isDiscChecked = in_array($disc->id, $ownedIds); @endphp
@endforeach
@endforeach