Menyelesaikan Menu KJPP

This commit is contained in:
2024-09-25 17:14:48 +07:00
parent 33ba88a276
commit 87a466385e
12 changed files with 360 additions and 70 deletions

View File

@@ -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)