fix(dokumen): perbaiki pengambilan nama custom field

- Mengubah cara pengambilan nama custom field dari objek JSON.
- Memastikan nilai input terisi dengan benar berdasarkan nama custom field.
This commit is contained in:
Daeng Deni Mardaeni
2025-01-30 21:19:05 +07:00
parent a7f2115b56
commit 33cbf385e6

View File

@@ -315,14 +315,13 @@
@if($detail->details)
@if($detail->jenisLegalitasJaminan->custom_fields)
@php $custom_field = json_decode($detail->details) @endphp
@foreach($custom_field as $key => $value)
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 capitalize">
{{ getCustomField($key)->label ?? "" }}
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input" type="text" name="custom_field[{{$detail->jenisLegalitasJaminan->id}}][{{$key}}]" value="{{ $value ?? '' }}">
<input class="input" type="text" name="custom_field[{{$detail->jenisLegalitasJaminan->id}}][{{getCustomField($key)->name}}]" value="{{ json_decode($detail->details)->{getCustomField($key)->name} ?? '' }}">
</div>
</div>
@endforeach