✨(laporan-admin-kredit): tambah kolom keterangan & kolektibilitas
- Tambah field `keterangan` (TEXT) & `kolektibilitas` (VARCHAR 10) pada tabel laporan_admin_kredit - Update model LaporanAdminKredit dengan fillable baru - Tambah dropdown kolektibilitas (1-5: Lancar, DPK, Kurang Lancar, Diragukan, Macet) di form - Tambah textarea keterangan dengan old() support untuk validasi - Validasi: `keterangan` nullable|string, `kolektibilitas` nullable|string|in:1..5 - Update controller: simpan field baru dengan DB transaction & error handling - Migration baru untuk menambah kolom `keterangan` & `kolektibilitas` - UI/UX: konsistensi styling, responsive grid layout, placeholder informatif - Testing: form simpan & validasi berhasil, migration jalan tanpa error
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
@@ -149,6 +150,8 @@
|
||||
$request->validate([
|
||||
'kode_register_t24' => 'nullable',
|
||||
'cif' => 'required',
|
||||
'keterangan' => 'nullable|string',
|
||||
'kolektibilitas' => 'nullable|string|in:1,2,3,4,5',
|
||||
]);
|
||||
|
||||
try {
|
||||
@@ -157,6 +160,8 @@
|
||||
// Update only the editable fields
|
||||
$laporanAdminKredit->update([
|
||||
'kode_register_t24' => $request->kode_register_t24,
|
||||
'keterangan' => $request->keterangan,
|
||||
'kolektibilitas' => $request->kolektibilitas,
|
||||
'updated_by' => Auth::id(),
|
||||
]);
|
||||
|
||||
|
||||
@@ -18,7 +18,9 @@ class LaporanAdminKredit extends Base
|
||||
'tanggal_kunjungan',
|
||||
'nilai_pasar_wajar',
|
||||
'nilai_likuidasi',
|
||||
'nama_penilai'
|
||||
'nama_penilai',
|
||||
'keterangan',
|
||||
'kolektibilitas'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
Reference in New Issue
Block a user