@php $teamComposition = $teamComposition ?? []; $readonly = $rulesLocked ?? false; $grid = $teamComposition['categoryGenderMax'] ?? config('league_rules_defaults.teamComposition.categoryGenderMax'); $missingCategoryIds = collect($grid)->contains(fn ($row) => empty($row['categoryId'])); @endphp @if ($missingCategoryIds && ! $readonly) @endif
@include('admin.leagues.rules._rules_card_header', ['title' => 'Squad Requirements'])
@include('admin.leagues.rules._rules_field', [ 'name' => 'teamComposition[squadSize]', 'id' => 'squadSize', 'label' => 'Total Squad Size', 'value' => (int) ($teamComposition['squadSize'] ?? 10), 'helper' => 'Min Via Auction', 'readonly' => $readonly, ]) @include('admin.leagues.rules._rules_field', [ 'name' => 'teamComposition[malePlayers]', 'id' => 'malePlayers', 'label' => 'Male Players', 'value' => (int) ($teamComposition['malePlayers'] ?? 6), 'helper' => 'Must be exactly 6', 'readonly' => $readonly, ]) @include('admin.leagues.rules._rules_field', [ 'name' => 'teamComposition[femalePlayers]', 'id' => 'femalePlayers', 'label' => 'Female Players', 'value' => (int) ($teamComposition['femalePlayers'] ?? 4), 'helper' => 'Must be exactly 4', 'readonly' => $readonly, ]) @include('admin.leagues.rules._rules_field', [ 'name' => 'teamComposition[minViaAuction]', 'id' => 'minViaAuction', 'label' => 'Min Via Auction', 'value' => (int) ($teamComposition['minViaAuction'] ?? 6), 'helper' => 'Must be at least 6', 'readonly' => $readonly, ])
@include('admin.leagues.rules._rules_card_header', [ 'title' => 'Category × Gender Maximum Grid', ])
Category Male Max Female Max
@foreach ($grid as $index => $row) @php $categoryId = $row['categoryId'] ?? null; $categoryLabel = ($row['name'] ?? 'Category') . ($categoryId ? ' (#' . $categoryId . ')' : ''); @endphp
{{ $categoryLabel }} @if ($categoryId) @endif
@endforeach