@php $idx = $index; // index of row-container $typeVal = (int) $type; // 1/2 @endphp
@lang('admin.cost_centers')
@php // لو فيه مراكز محفوظة للبند، اعرضها $rows = []; if(isset($selected_centers) && $selected_centers->count()){ foreach($selected_centers as $centerId => $items){ $first = $items->first(); $rows[] = [ 'center_id' => $centerId, 'perc' => $first->amount_perc, 'amount' => $first->amount, ]; } } else { // row افتراضي واحد $rows[] = ['center_id' => '', 'perc' => 100, 'amount' => 0]; } @endphp @foreach($rows as $k => $r)
@endforeach