Add support for multiple detail sertifikat

Enhanced the request validation, model, and Blade template to support multiple detail sertifikat entries, which are now encoded in JSON format. Additionally, added a dynamic form for entry, including delete functionality for each sertifikat entry.
This commit is contained in:
Daeng Deni Mardaeni
2024-11-01 16:53:31 +07:00
parent 5201cdb0e3
commit 24b38ca4f1
4 changed files with 87 additions and 34 deletions

View File

@@ -63,6 +63,7 @@
public function update(PemilikJaminanRequest $request, $id, $pemilik)
{
$validate = $request->validated();
if ($validate) {
try {
$pemilik = PemilikJaminan::find($pemilik);
@@ -88,6 +89,7 @@
$districts = District::where('city_code', $pemilik->city_code)->get();
$villages = Village::where('district_code', $pemilik->district_code)->get();
$hubunganPemilik = HubunganPemilikJaminan::all();
$detailSertifikat = $pemilik->detail_sertifikat;
return view(
'lpj::pemilik_jaminan.form',
@@ -99,6 +101,7 @@
'villages',
'hubunganPemilik',
'pemilik',
'detailSertifikat'
),
);
}