feat(laporan_external): tambahkan fitur laporan eksternal

- Menambahkan entri untuk Laporan External di module.json.
- Menambahkan breadcrumb untuk Laporan External di breadcrumbs.php.
- Membuat migrasi untuk tabel laporan_externals.
- Menambahkan rute untuk Laporan External di web.php.
- Memperbarui validasi di LaporanExternalRequest untuk mendukung nullable fields.
- Mengimplementasikan LaporanExternalController untuk menangani operasi CRUD.
This commit is contained in:
Daeng Deni Mardaeni
2025-03-06 09:56:59 +07:00
parent 38b22bce38
commit dd5271a40b
8 changed files with 455 additions and 21 deletions

View File

@@ -6,9 +6,11 @@ use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Modules\Lpj\Models\LaporanExternal;
use Modules\Lpj\Http\Requests\LaporanExternalRequest;
use Modules\Lpj\Models\Permohonan;
class LaporanExternalController extends Controller
{
public $user;
/**
* Display a listing of the resource.
*/
@@ -43,7 +45,7 @@ class LaporanExternalController extends Controller
LaporanExternal::create($validatedData);
return redirect()->route('lpj.laporan_external.index')->with('success', 'Laporan External berhasil ditambahkan.');
return redirect()->route('laporan-external.index')->with('success', 'Laporan External berhasil ditambahkan.');
}
/**
@@ -59,7 +61,8 @@ class LaporanExternalController extends Controller
*/
public function edit(LaporanExternal $laporanExternal)
{
return view('lpj::laporan_external.edit', compact('laporanExternal'));
$permohonan = Permohonan::find($laporanExternal->permohonan_id);
return view('lpj::laporan_external.create', compact('laporanExternal','permohonan'));
}
/**
@@ -79,7 +82,7 @@ class LaporanExternalController extends Controller
$laporanExternal->update($validatedData);
return redirect()->route('lpj.laporan_external.index')->with('success', 'Laporan External berhasil diperbarui.');
return redirect()->route('laporan-external.index')->with('success', 'Laporan External berhasil diperbarui.');
}
/**
@@ -89,7 +92,7 @@ class LaporanExternalController extends Controller
{
$laporanExternal->delete();
return redirect()->route('lpj.laporan_external.index')->with('success', 'Laporan External berhasil dihapus.');
return redirect()->route('laporan-external.index')->with('success', 'Laporan External berhasil dihapus.');
}
public function dataForDatatables(Request $request)
@@ -122,7 +125,6 @@ class LaporanExternalController extends Controller
->orWhere('indikasi_nilai_pasar_kendaraan_alat_berat', 'LIKE', "%$search%")
->orWhere('file_resume', 'LIKE', "%$search%")
->orWhere('file_laporan', 'LIKE', "%$search%");
->orWhere('tanggal_laporan', 'LIKE', "%$search%");
});
}

View File

@@ -13,18 +13,18 @@
: array
{
return [
'permohonan_id' => 'required|exists:permohonans,id',
'nomor_laporan' => 'required|string|max:255',
'tgl_final_laporan' => 'required|date',
'nilai_pasar' => 'required|numeric',
'indikasi_nilai_likuidasi' => 'required|numeric',
'indikasi_nilai_pasar_tanah' => 'required|numeric',
'estimasi_harga_tanah' => 'required|numeric',
'estimasi_harga_bangunan' => 'required|numeric',
'indikasi_nilai_pasar_bangunan' => 'required|numeric',
'indikasi_nilai_pasar_sarana_pelengkap' => 'required|numeric',
'indikasi_nilai_pasar_mesin' => 'required|numeric',
'indikasi_nilai_pasar_kendaraan_alat_berat' => 'required|numeric',
'permohonan_id' => 'required|exists:permohonan,id',
'nomor_laporan' => 'nullable|string|max:255',
'tgl_final_laporan' => 'nullable|date',
'nilai_pasar' => 'nullable|numeric',
'indikasi_nilai_likuidasi' => 'nullable|numeric',
'indikasi_nilai_pasar_tanah' => 'nullable|numeric',
'estimasi_harga_tanah' => 'nullable|numeric',
'estimasi_harga_bangunan' => 'nullable|numeric',
'indikasi_nilai_pasar_bangunan' => 'nullable|numeric',
'indikasi_nilai_pasar_sarana_pelengkap' => 'nullable|numeric',
'indikasi_nilai_pasar_mesin' => 'nullable|numeric',
'indikasi_nilai_pasar_kendaraan_alat_berat' => 'nullable|numeric',
'file_resume' => 'nullable|file|mimes:pdf|max:10240', // 10MB max
'file_laporan' => 'nullable|file|mimes:pdf|max:10240',
];