From a0a8fd3c29328da51a9c03f1169434ab65e0bfa1 Mon Sep 17 00:00:00 2001 From: rahmatrafli1 Date: Wed, 25 Sep 2024 17:14:48 +0700 Subject: [PATCH 1/5] Menyelesaikan Menu KJPP --- app/Exports/KJPPExport.php | 44 +++++- app/Http/Controllers/KJPPController.php | 103 +++++++++++-- app/Http/Requests/KJPPRequest.php | 13 +- app/Models/Branch.php | 5 - app/Models/IjinUsaha.php | 6 - app/Models/JenisJaminan.php | 6 - app/Models/KJPP.php | 20 +-- resources/views/kjpp/create.blade.php | 23 ++- resources/views/kjpp/index.blade.php | 2 +- resources/views/kjpp/show.blade.php | 195 ++++++++++++++++++++++++ 10 files changed, 347 insertions(+), 70 deletions(-) create mode 100644 resources/views/kjpp/show.blade.php diff --git a/app/Exports/KJPPExport.php b/app/Exports/KJPPExport.php index f8026c0..86f3473 100644 --- a/app/Exports/KJPPExport.php +++ b/app/Exports/KJPPExport.php @@ -6,14 +6,14 @@ use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithColumnFormatting; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; -use Modules\Lpj\Models\IjinUsaha; +use Modules\Lpj\Models\KJPP; use PhpOffice\PhpSpreadsheet\Style\NumberFormat; class KJPPExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping { public function collection() { - return IjinUsaha::all(); + return KJPP::all(); } public function map($row): array @@ -23,6 +23,26 @@ class KJPPExport implements WithColumnFormatting, WithHeadings, FromCollection, $row->code, $row->name, $row->jenis_kantor, + $row->nomor_ijin_usaha, + $row->province_code, + $row->city_code, + $row->district_code, + $row->village_code, + $row->address, + $row->postal_code, + $row->nomor_telepon_kantor, + $row->email_kantor, + $row->nama_pimpinan, + $row->nomor_hp_pimpinan, + $row->nama_pic_reviewer, + $row->nomor_hp_pic_reviewer, + $row->nama_pic_admin, + $row->nomor_hp_pic_admin, + $row->nama_pic_marketing, + $row->nomor_hp_pic_marketing, + $row->ijin_usaha_id, + $row->jenis_aset_id, + $row->attachment, $row->created_at ]; } @@ -34,6 +54,26 @@ class KJPPExport implements WithColumnFormatting, WithHeadings, FromCollection, 'Code', 'Name', 'Jenis Kantor / Cabang', + 'Nomor Ijin Usaha', + 'Province Code', + 'City Code', + 'District Code', + 'Village Code', + 'Address', + 'Postal Code', + 'Nomor Telepon Kantor', + 'Email Kantor', + 'Nama Pimpinan', + 'Nomor HP Pimpinan', + 'Nama PIC Reviewer', + 'Nomor HP PIC Reviewer', + 'Nama PIC Admin', + 'Nomor HP PIC Admin', + 'Nama PIC Marketing', + 'Nomor HP PIC Marketing', + 'Ijin Usaha ID', + 'Jenis Aset ID', + 'Attachment', 'Created At' ]; } diff --git a/app/Http/Controllers/KJPPController.php b/app/Http/Controllers/KJPPController.php index 8be9d4d..f1f613b 100644 --- a/app/Http/Controllers/KJPPController.php +++ b/app/Http/Controllers/KJPPController.php @@ -2,15 +2,19 @@ namespace Modules\Lpj\Http\Controllers; +use Throwable; use Illuminate\Http\Request; use Modules\Lpj\Models\KJPP; use Illuminate\Http\Response; use Modules\Lpj\Models\Branch; +use Modules\Location\Models\City; use Modules\Lpj\Models\IjinUsaha; use Modules\Lpj\Exports\KJPPExport; use App\Http\Controllers\Controller; use Maatwebsite\Excel\Facades\Excel; +use Modules\Location\Models\Village; use Modules\Lpj\Models\JenisJaminan; +use Modules\Location\Models\District; use Modules\Location\Models\Province; use Illuminate\Support\Facades\Storage; use Modules\Lpj\Http\Requests\KJPPRequest; @@ -44,24 +48,33 @@ class KJPPController extends Controller */ public function store(KJPPRequest $request) { - $validate = $request->validated(); + $validated = $request->validated(); - - if ($validate) { + if ($validated) { $file = $request->file('attachment'); $filename = $file ? time() . '.' . $file->getClientOriginalExtension() : 'default.pdf'; if ($file) { - $file->storeAs('uploads_pdf', $filename, 'public'); + // Simpan file yang diunggah + $file->storeAs('public/uploads_pdf', $filename); } else { - Storage::copy('/home/bagi/Downloads/default.pdf', 'public/uploads_pdf/' . $filename); + // Salin file default ke lokasi yang diinginkan + Storage::copy('public/test/default.pdf', 'public/uploads_pdf/' . $filename); } - dd($validate); - KJPP::create($validate); + // Tambahkan nama file ke data yang divalidasi + $validated['attachment'] = $filename; + + // Simpan data ke database + KJPP::create($validated); + return redirect() ->route('basicdata.kjpp.index') - ->with('success', 'Ijin Usaha created successfully'); + ->with('success', 'KJPP created successfully'); + } else { + return redirect() + ->route('basicdata.kjpp.create') + ->with('error', 'Validation failed'); } } @@ -70,7 +83,17 @@ class KJPPController extends Controller */ public function show($id) { - return view('lpj::show'); + $kjpp = KJPP::find($id); + $ijin_usaha = IjinUsaha::where('code', $kjpp->nomor_ijin_usaha)->get(); + $ijin_usahas = IjinUsaha::all(); + $jenis_jaminan = JenisJaminan::all(); + $branches = Branch::where('name', $kjpp->jenis_kantor)->get(); + $provinces = Province::where('code', $kjpp->province_code)->get(); + $cities = City::where('code', $kjpp->city_code)->get(); + $districts = District::where('code', $kjpp->district_code)->get(); + $villages = Village::where('code', $kjpp->village_code)->get(); + // dd($branches); + return view('lpj::kjpp.show', compact('jenis_jaminan', 'ijin_usahas', 'ijin_usaha', 'branches', 'kjpp', 'provinces', 'cities', 'districts', 'villages')); } /** @@ -78,15 +101,53 @@ class KJPPController extends Controller */ public function edit($id) { - return view('lpj::edit'); + $kjpp = KJPP::find($id); + $branch = Branch::all(); + $ijin_usaha = IjinUsaha::all(); + $jenis_aset = JenisJaminan::all(); + $provinces = Province::all(); + $cities = City::where('province_code', $kjpp->province_code)->get(); + $districts = District::where('city_code', $kjpp->city_code)->get(); + $villages = Village::where('district_code', $kjpp->district_code)->get(); + + return view('lpj::kjpp.create', compact('kjpp', 'branch', 'ijin_usaha', 'jenis_aset', 'provinces', 'cities', 'districts', 'villages')); } /** * Update the specified resource in storage. */ - public function update(KJPP $request, $id) + public function update(KJPPRequest $request, $id) { - // + $validated = $request->validated(); + + if ($validated) { + $file = $request->file('attachment'); + $filename = $file ? time() . '.' . $file->getClientOriginalExtension() : null; + + if ($file !== null) { + // Jika ada file dari database maka hapus file yang lama ke file yang baru + $kjpp = KJPP::find($id); + // Storage::delete('public/uploads_pdf/' . $kjpp->attachment); + // Simpan file yang diunggah + $file->storeAs('public/uploads_pdf', $filename); + $validated['attachment'] = $filename; + } else { + // Jika tidak ada file yang diunggah, gunakan file yang sudah ada atau file default + $kjpp = KJPP::find($id); + $validated['attachment'] = $kjpp->attachment ?? 'default.pdf'; + } + + // Perbarui data di database + KJPP::where('id', $id)->update($validated); + + return redirect() + ->route('basicdata.kjpp.index') + ->with('success', 'KJPP updated successfully'); + } else { + return redirect() + ->route('basicdata.kjpp.edit', $id) + ->with('error', 'Validation failed'); + } } /** @@ -94,7 +155,21 @@ class KJPPController extends Controller */ public function destroy($id) { - // + try { + $kjpp = KJPP::find($id); + + // Jangan hapus file default.pdf + if ($kjpp->attachment && $kjpp->attachment !== 'default.pdf') { + Storage::delete('public/uploads_pdf/' . $kjpp->attachment); + } + + // Hapus data dari database + $kjpp->delete(); + + echo json_encode(['success' => true, 'message' => 'KJPP deleted successfully']); + } catch (Throwable $e) { + echo json_encode(['success' => false, 'message' => 'Failed to delete branch: ' . $e]); + } } public function dataForDatatables(Request $request) @@ -161,6 +236,6 @@ class KJPPController extends Controller public function export() { - return Excel::download(new KJPPExport, 'currency.xlsx'); + return Excel::download(new KJPPExport, 'kjpp.xlsx'); } } diff --git a/app/Http/Requests/KJPPRequest.php b/app/Http/Requests/KJPPRequest.php index b5f4622..3b5c637 100644 --- a/app/Http/Requests/KJPPRequest.php +++ b/app/Http/Requests/KJPPRequest.php @@ -32,8 +32,8 @@ class KJPPRequest extends FormRequest 'nomor_hp_pic_admin' => 'required|numeric|digits_between:10,15', 'nama_pic_marketing' => 'required|string|not_regex:/^\d+$/|max:255', 'nomor_hp_pic_marketing' => 'required|numeric|digits_between:10,15', - 'ijin_usaha.*' => 'nullable', - 'jenis_jaminan.*' => 'nullable', + 'ijin_usaha_id' => 'nullable', + 'jenis_aset_id' => 'nullable', 'attachment' => 'nullable|mimes:pdf|max:1024' ]; @@ -56,15 +56,6 @@ class KJPPRequest extends FormRequest public function prepareForValidation(): void { - if ($this->method() == 'POST') { - $this->merge([ - 'code' => IdGenerator::generate( - ['table' => 'ijin_usaha', 'length' => 5, 'prefix' => 'IU', 'field' => 'code'], - ['table' => 'jenis_jaminan', 'length' => 5, 'prefix' => 'JJ', 'field' => 'code'], - ) - ]); - } - $this->merge([ 'ijin_usaha_id' => json_encode($this->ijin_usaha_id), 'jenis_aset_id' => json_encode($this->jenis_aset_id) diff --git a/app/Models/Branch.php b/app/Models/Branch.php index 4ca5bd9..834b5cc 100644 --- a/app/Models/Branch.php +++ b/app/Models/Branch.php @@ -13,9 +13,4 @@ class Branch extends Base { return $this->hasMany(Debiture::class, 'branch_id', 'id'); } - - public function kjpp() - { - return $this->belongsTo(KJPP::class); - } } diff --git a/app/Models/IjinUsaha.php b/app/Models/IjinUsaha.php index 522a183..e2e464a 100644 --- a/app/Models/IjinUsaha.php +++ b/app/Models/IjinUsaha.php @@ -15,10 +15,4 @@ class IjinUsaha extends Model * The attributes that are mass assignable. */ protected $fillable = ['code', 'name']; - - // relasi ke kjpp - public function kjpp() - { - return $this->belongsTo(KJPP::class); - } } diff --git a/app/Models/JenisJaminan.php b/app/Models/JenisJaminan.php index a630686..e8f4e17 100644 --- a/app/Models/JenisJaminan.php +++ b/app/Models/JenisJaminan.php @@ -6,10 +6,4 @@ class JenisJaminan extends Base { protected $table = 'jenis_jaminan'; protected $fillable = ['code', 'name', 'slug', 'jenis_legalitas_jaminan_id']; - - // relasi ke kjpp - public function kjpp() - { - return $this->belongsTo(KJPP::class); - } } diff --git a/app/Models/KJPP.php b/app/Models/KJPP.php index e535941..426d940 100644 --- a/app/Models/KJPP.php +++ b/app/Models/KJPP.php @@ -4,6 +4,8 @@ namespace Modules\Lpj\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; +use Modules\Location\Models\Province; + // use Modules\Lpj\Database\Factories\KJPPFactory; class KJPP extends Model @@ -41,22 +43,4 @@ class KJPP extends Model 'jenis_aset_id', 'attachment' ]; - - // relasi ke branch - public function branch() - { - return $this->hasOne(Branch::class, 'jenis_kantor'); - } - - // relasi ke jenis aset - public function jenis_aset() - { - return $this->hasMany(JenisJaminan::class, 'jenis_aset_id'); - } - - // relasi ke ijin usaha - public function ijin_usaha() - { - return $this->hasMany(IjinUsaha::class, 'ijin_usaha_id'); - } } diff --git a/resources/views/kjpp/create.blade.php b/resources/views/kjpp/create.blade.php index 78db2c2..977fe3f 100644 --- a/resources/views/kjpp/create.blade.php +++ b/resources/views/kjpp/create.blade.php @@ -58,7 +58,7 @@ @if (isset($kjpp)) @foreach ($branch as $branches) @endforeach @@ -85,7 +85,7 @@ @if (isset($kjpp)) @foreach ($ijin_usaha as $branches) @endforeach @@ -351,11 +351,11 @@ @if (isset($kjpp->ijin_usaha_id)) code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true)))) {{ 'checked' }} @endif - value="{{ $row->code }}" name="ijin_usaha[]" /> + value="{{ $row->code }}" name="ijin_usaha_id[]" /> @else code, old('ijin_usaha_id', []))) {{ 'checked' }} @endif - value="{{ $row->code }}" name="ijin_usaha[]" /> + value="{{ $row->code }}" name="ijin_usaha_id[]" /> @endif {{ $row->name }} @@ -366,7 +366,7 @@
@foreach ($jenis_aset as $row) @@ -374,11 +374,11 @@ @if (isset($kjpp->jenis_aset_id)) code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id, true)))) {{ 'checked' }} @endif - value="{{ $row->code }}" name="jenis_jaminan[]" /> + value="{{ $row->code }}" name="jenis_aset_id[]" /> @else code, old('jenis_aset_id', []))) {{ 'checked' }} @endif - value="{{ $row->code }}" name="jenis_jaminan[]" /> + value="{{ $row->code }}" name="jenis_aset_id[]" /> @endif {{ $row->name }} @@ -392,6 +392,15 @@ Attachment
+ @if (isset($kjpp) && $kjpp->attachment) + + @endif @error('attachment') diff --git a/resources/views/kjpp/index.blade.php b/resources/views/kjpp/index.blade.php index 40cf230..20777a5 100644 --- a/resources/views/kjpp/index.blade.php +++ b/resources/views/kjpp/index.blade.php @@ -136,7 +136,7 @@ title: 'Action', render: (item, data) => { return `
- + diff --git a/resources/views/kjpp/show.blade.php b/resources/views/kjpp/show.blade.php new file mode 100644 index 0000000..14e9ae3 --- /dev/null +++ b/resources/views/kjpp/show.blade.php @@ -0,0 +1,195 @@ +@extends('layouts.main') + +@section('breadcrumbs') + {{ Breadcrumbs::render(request()->route()->getName()) }} +@endsection + +@section('content') +
+
+ +
+
+ +
+

{{ $kjpp->code }}

+
+ +
+

{{ $kjpp->name }}

+
+
+
+ +
+

+ @foreach ($branches as $branch) + {{ $branch->name }} + @endforeach +

+
+ +
+

+ @foreach ($ijin_usaha as $iu) + {{ $iu->code }} + @endforeach +

+
+
+
+ +
+

{{ $kjpp->address }} , Kel. + @foreach ($villages as $village) + {{ $village->name }} + @endforeach , Kec. + @foreach ($districts as $district) + {{ $district->name }} + @endforeach , + @foreach ($cities as $city) + {{ $city->name }} + @endforeach , + @foreach ($provinces as $province) + {{ $province->name }} + @endforeach, Kode Pos. + @foreach ($villages as $village) + {{ $village->postal_code }} + @endforeach +

+
+
+
+ +
+

{{ $kjpp->nomor_telepon_kantor }}

+
+ +
+

{{ $kjpp->email_kantor }}

+
+
+
+ +
+

{{ $kjpp->nama_pimpinan }}

+
+ +
+

{{ $kjpp->nomor_hp_pimpinan }}

+
+
+
+ +
+

{{ $kjpp->nama_pic_reviewer }}

+
+ +
+

{{ $kjpp->nomor_hp_pic_reviewer }}

+
+
+
+ +
+

{{ $kjpp->nama_pic_admin }}

+
+ +
+

{{ $kjpp->nomor_hp_pic_admin }}

+
+
+
+ +
+

{{ $kjpp->nama_pic_marketing }}

+
+ +
+

{{ $kjpp->nomor_hp_pic_marketing }}

+
+
+
+ +
+ @foreach ($ijin_usahas as $row) + + @endforeach +
+
+
+ +
+ @foreach ($jenis_jaminan as $row) + + @endforeach +
+
+
+ + +
+
+
+
+@endsection From 53edfab17a5ba013483feb052b4a4d9b892670d4 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Thu, 26 Sep 2024 02:03:38 +0000 Subject: [PATCH 2/5] update from server --- app/Http/Requests/PemilikJaminanRequest.php | 4 +- ...024_08_12_023807_create_branches_table.php | 39 ------------------- .../debitur/components/pemilik.blade.php | 2 +- .../views/pemilik_jaminan/form.blade.php | 4 +- 4 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 database/migrations/2024_08_12_023807_create_branches_table.php diff --git a/app/Http/Requests/PemilikJaminanRequest.php b/app/Http/Requests/PemilikJaminanRequest.php index dd4a11d..b6e267d 100644 --- a/app/Http/Requests/PemilikJaminanRequest.php +++ b/app/Http/Requests/PemilikJaminanRequest.php @@ -28,8 +28,8 @@ 'status' => 'nullable|boolean', ]; - $rules['nomor_id'] = 'nullable|max:16|unique:pemilik_jaminan,nomor_id,debiture_id,' . $this->debiture_id; - + //$rules['nomor_id'] = 'nullable|max:16|unique:pemilik_jaminan,nomor_id,debiture_id,' . $this->debiture_id; + $rules['nomor_id'] = 'nullable|max:16|unique:pemilik_jaminan,debiture_id,' . $this->debiture_id; return $rules; } diff --git a/database/migrations/2024_08_12_023807_create_branches_table.php b/database/migrations/2024_08_12_023807_create_branches_table.php deleted file mode 100644 index bf4e9a8..0000000 --- a/database/migrations/2024_08_12_023807_create_branches_table.php +++ /dev/null @@ -1,39 +0,0 @@ -id(); - $table->string('code', 9)->unique(); - $table->string('name'); - $table->boolean('status')->default(true)->nullable(); - $table->timestamps(); - $table->timestamp('authorized_at')->nullable(); - $table->char('authorized_status', 1)->nullable(); - $table->softDeletes(); - - $table->unsignedBigInteger('created_by')->nullable(); - $table->unsignedBigInteger('updated_by')->nullable(); - $table->unsignedBigInteger('deleted_by')->nullable(); - $table->unsignedBigInteger('authorized_by')->nullable(); - }); - } - - /** - * Reverse the migrations. - */ - public function down() - : void - { - Schema::dropIfExists('branches'); - } - }; diff --git a/resources/views/debitur/components/pemilik.blade.php b/resources/views/debitur/components/pemilik.blade.php index 16fb025..eb59ff7 100644 --- a/resources/views/debitur/components/pemilik.blade.php +++ b/resources/views/debitur/components/pemilik.blade.php @@ -85,7 +85,7 @@ alamat

- {{ $pemilik->address.', '.$pemilik->village->name.', '.$pemilik->city->name.', '.$pemilik->province->name.', '.$pemilik->postal_code }} + {{ $pemilik->address ?? '' }}, {{ $pemilik->village->name ?? ''}}, {{ $pemilik->city->name ?? ''}}, {{ $pemilik->province->name ?? '' }}, {{ $pemilik->postal_code ?? '' }}

diff --git a/resources/views/pemilik_jaminan/form.blade.php b/resources/views/pemilik_jaminan/form.blade.php index 1efcb79..03c4a11 100644 --- a/resources/views/pemilik_jaminan/form.blade.php +++ b/resources/views/pemilik_jaminan/form.blade.php @@ -267,13 +267,13 @@
- + @error('name') {{ $message }} @enderror
- + @error('nomor_id') {{ $message }} @enderror From e19e3e79911023eb06adad886e75e93d758a9725 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Thu, 26 Sep 2024 09:12:46 +0700 Subject: [PATCH 3/5] update menu --- module.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/module.json b/module.json index ba10412..3d11d99 100644 --- a/module.json +++ b/module.json @@ -92,6 +92,28 @@ "administrator" ] }, + { + "title": "Assignment", + "path": "penilaian", + "icon": "ki-filled ki-badge", + "classes": "", + "attributes": [], + "permission": "", + "roles": [ + "Administrator" + ] + }, + { + "title": "Activity", + "path": "activity", + "icon": "ki-filled ki-some-files text-lg", + "classes": "", + "attributes": [], + "permission": "", + "roles": [ + "Administrator" + ] + }, { "title": "Laporan", "path": "", From 1f7b50cdb6f87eb3698eb235915705ab607f0566 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Thu, 26 Sep 2024 09:21:43 +0700 Subject: [PATCH 4/5] update migration penilaian --- ...24_09_26_021850_update_penilaian_table.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 database/migrations/2024_09_26_021850_update_penilaian_table.php diff --git a/database/migrations/2024_09_26_021850_update_penilaian_table.php b/database/migrations/2024_09_26_021850_update_penilaian_table.php new file mode 100644 index 0000000..80f7db0 --- /dev/null +++ b/database/migrations/2024_09_26_021850_update_penilaian_table.php @@ -0,0 +1,38 @@ +string('nomor_registrasi')->references('nomor_registrasi')->on(Permohonan::class)->onDelete('cascade'); + $table->integer('penilai_id')->unsigned()->nullable(); + $table->integer('surveyor_id')->unsigned()->nullable(); + $table->integer('penilai_surveyor_id')->unsigned()->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('penilaian', function (Blueprint $table) { + $table->dropForeign(['nomor_registrasi']); + $table->dropForeign(['penilai_id']); + $table->dropForeign(['surveyor_id']); + $table->dropForeign(['penilai_surveyor_id']); + $table->dropColumn('nomor_registrasi'); + $table->dropColumn('penilai_id'); + $table->dropColumn('surveyor_id'); + $table->dropColumn('penilai_surveyor_id'); + }); + } +}; From fcb6a5255d6032cbb657bdfb4230ff8ea2c9eea8 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Thu, 26 Sep 2024 09:31:16 +0700 Subject: [PATCH 5/5] update route --- routes/web.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/routes/web.php b/routes/web.php index 0a23239..ddddfa6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -323,6 +323,33 @@ Route::resource('ijin_usaha', IjinUsahaController::class); }); + Route::name('debitur.')->prefix('debitur')->group(function () { + Route::get('restore/{id}', [DebitureController::class, 'restore'])->name('restore'); + Route::get('datatables', [DebitureController::class, 'dataForDatatables']) + ->name('datatables'); + Route::get('export', [DebitureController::class, 'export'])->name('export'); + + + Route::name('jaminan.')->prefix('{id}/jaminan')->group(function () { + Route::get('download/{dokumen}', [DokumenJaminanController::class, 'download'])->name('download'); + Route::get('/', [DokumenJaminanController::class, 'index'])->name('index'); + Route::get('create', [DokumenJaminanController::class, 'create'])->name('create'); + Route::get('{jaminan}/edit', [DokumenJaminanController::class, 'edit'])->name('edit'); + Route::put('{jaminan}', [DokumenJaminanController::class, 'update'])->name('update'); + Route::post('store', [DokumenJaminanController::class, 'store'])->name('store'); + Route::delete('{jaminan}', [DokumenJaminanController::class, 'destroy'])->name('destroy'); + }); + + Route::name('pemilik.')->prefix('{id}/pemilik')->group(function () { + Route::get('/', [PemilikJaminanController::class, 'index'])->name('index'); + Route::get('create', [PemilikJaminanController::class, 'create'])->name('create'); + Route::get('{pemilik}/edit', [PemilikJaminanController::class, 'edit'])->name('edit'); + Route::put('{pemilik}', [PemilikJaminanController::class, 'update'])->name('update'); + Route::post('store', [PemilikJaminanController::class, 'store'])->name('store'); + Route::delete('{pemilik}', [PemilikJaminanController::class, 'destroy'])->name('destroy'); + }); + }); + Route::resource('debitur', DebitureController::class); Route::name('penilaian.')->prefix('penilaian')->group(function () {