Update Module Debitur
penambahan default cif 0x10 dan di buat mandatory update field npwp input harus minimal 15 dan maksimal 16 digit penambahan rules
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Modules\Lpj\Rules\UniqueCifExceptZero;
|
||||
|
||||
class DebitureRequest extends FormRequest
|
||||
{
|
||||
@@ -21,7 +22,7 @@
|
||||
'nomor_rekening' => 'nullable|string|max:50',
|
||||
'name' => 'required',
|
||||
'registered_at' => 'nullable|date',
|
||||
'npwp' => 'nullable|string|max:16',
|
||||
'npwp' => 'nullable|string|min:15|max:16',
|
||||
'email' => 'nullable|email',
|
||||
'phone' => 'nullable|string|max:15',
|
||||
'address' => 'nullable|string',
|
||||
@@ -29,10 +30,10 @@
|
||||
'status' => 'nullable|boolean'
|
||||
];
|
||||
|
||||
if ($this->method() == 'PUT') {
|
||||
$rules['cif'] = 'nullable|unique:debitures,cif,' . $this->id;
|
||||
} else {
|
||||
$rules['cif'] = 'nullable|unique:debitures,cif';
|
||||
if($this->method() == 'PUT'){
|
||||
$rules['cif'] = ['required', new UniqueCifExceptZero($this->id)];
|
||||
}else{
|
||||
$rules['cif'] = ['required', new UniqueCifExceptZero(null)];
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
||||
Reference in New Issue
Block a user