Merge remote-tracking branch 'origin/staging' into feature/senior-officer

# Conflicts:
#	app/Http/Controllers/PermohonanController.php
#	routes/breadcrumbs.php
#	routes/web.php
This commit is contained in:
Daeng Deni Mardaeni
2024-09-19 10:47:39 +07:00
22 changed files with 1477 additions and 434 deletions

View File

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

View File

@@ -14,13 +14,15 @@
: array
{
$rules = [
'nomor_registrasi' => 'nullable|string|max:10',
'tanggal_permohonan' => 'nullable|date',
'user_id' => 'nullable|exists:users,id',
'branch_id' => 'required|exists:branches,id',
'tujuan_penilaian_id' => 'required|exists:tujuan_penilaian,id',
'debiture_id' => 'required|exists:debitures,id',
'status' => 'required|string',
'nomor_registrasi' => 'nullable|string|max:10',
'tanggal_permohonan' => 'nullable|date',
'user_id' => 'nullable|exists:users,id',
'branch_id' => 'required|exists:branches,id',
'tujuan_penilaian_id' => 'required|exists:tujuan_penilaian,id',
'debiture_id' => 'required|exists:debitures,id',
'status' => 'required|string',
'jenis_fasilitas_kredit_id' => 'required|exists:jenis_fasilitas_kredit,id',
'nilai_plafond_id' => 'required|exists:nilai_plafond,id',
];
return $rules;

View File

@@ -16,6 +16,7 @@
$rules = [
'description' => 'nullable|max:255',
'status' => 'required|boolean',
'slug' => 'nullable|max:255',
];
if ($this->method() == 'PUT') {
@@ -37,9 +38,9 @@
public function prepareForValidation()
{
$this->merge([
return $this->merge([
'status' => isset($this->status) ? 1 : 0,
'slug'=> Str::slug($this->name)
'slug' => Str::slug($this->name),
]);
}
}