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:
@@ -315,14 +315,13 @@
|
|||||||
|
|
||||||
@if($detail->details)
|
@if($detail->details)
|
||||||
@if($detail->jenisLegalitasJaminan->custom_fields)
|
@if($detail->jenisLegalitasJaminan->custom_fields)
|
||||||
@php $custom_field = json_decode($detail->details) @endphp
|
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
|
||||||
@foreach($custom_field as $key => $value)
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
<label class="form-label max-w-56 capitalize">
|
<label class="form-label max-w-56 capitalize">
|
||||||
{{ getCustomField($key)->label ?? "" }}
|
{{ getCustomField($key)->label ?? "" }}
|
||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|||||||
Reference in New Issue
Block a user