@php // Konwersja danych z old() $oldItems = collect(old('items_to_repair', [])); $oldMechanics = old('items_mechanics', []); $itemPriority = old('item_priority', []); // Pozycje z przypisanym mechanic_id (int!) $itemsWithMechanics = $oldItems->map(function ($item, $index) use ($oldMechanics, $itemPriority) { return [ 'text' => $item, 'mechanic_id' => isset($oldMechanics[$index]) ? (int) $oldMechanics[$index] : null, 'priority' => isset($itemPriority[$index]) ? (int) $itemPriority[$index] : 1, // domyślnie 1 ]; }); @endphp
{{-- --}} {{--
--}}

{{--        --}}

{{--        --}}
{{--            {{ __('vehicle.repair.add.btn_add') }}--}}
{{--        --}}

{{--        --}}
{{--        
--}} {{-- --}} {{--
--}} {{-- --}} {{----}}