Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into tender
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Modules\Lpj\Rules\UniqueCifExceptZero;
|
||||
use Modules\Lpj\Rules\UniqueExcept;
|
||||
|
||||
class DebitureRequest extends FormRequest
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
'address' => 'nullable|string',
|
||||
'postal_code' => 'nullable|string|max:10',
|
||||
'status' => 'nullable|boolean',
|
||||
'detail_sertifikat' => 'nullable|string|max:255',
|
||||
];
|
||||
|
||||
//$rules['nomor_id'] = 'nullable|max:16|unique:pemilik_jaminan,nomor_id,debiture_id,' . $this->debiture_id;
|
||||
@@ -41,4 +42,26 @@
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function prepareForValidation() {
|
||||
|
||||
$detailSertifikat = [];
|
||||
$names = $this->input('detail_sertifikat.name', []);
|
||||
$nomorIds = $this->input('detail_sertifikat.nomor_id', []);
|
||||
|
||||
foreach ($names as $index => $name) {
|
||||
if (isset($nomorIds[$index])) {
|
||||
$detailSertifikat[] = [
|
||||
'name' => $name,
|
||||
'nomor_id' => $nomorIds[$index]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$this->merge([
|
||||
'detail_sertifikat' => json_encode($detailSertifikat),
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user