Feature #14 : Dokumen Jaminan

This commit is contained in:
Daeng Deni Mardaeni
2024-08-21 13:42:55 +07:00
parent 5c380f5eb6
commit 9c05779fbd
16 changed files with 1052 additions and 247 deletions

View File

@@ -22,7 +22,6 @@
'name' => 'required',
'registered_at' => 'nullable|date',
'npwp' => 'nullable|string|max:16',
'nomor_id' => 'nullable|string|max:16',
'email' => 'nullable|email',
'phone' => 'nullable|string|max:15',
'address' => 'nullable|string',
@@ -31,9 +30,9 @@
];
if ($this->method() == 'PUT') {
$rules['cif'] = 'required|unique:debitures,cif,' . $this->id;
$rules['cif'] = 'nullable|unique:debitures,cif,' . $this->id;
} else {
$rules['cif'] = 'required|unique:debitures,cif';
$rules['cif'] = 'nullable|unique:debitures,cif';
}
return $rules;

View File

@@ -0,0 +1,42 @@
<?php
namespace Modules\Lpj\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class DokumenJaminanRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules()
: array
{
$rules = [
'pemilik_jaminan_id' => 'required',
'jenis_jaminan_id' => 'required',
'jenis_legalitas_jaminan_id' => 'required',
'dokumen_jaminan' => 'nullable|file|mimes:pdf',
'keterangan' => 'nullable|string|max:255',
'province_code' => 'nullable|exists:provinces,code',
'city_code' => 'nullable|exists:cities,code',
'district_code' => 'nullable|exists:districts,code',
'village_code' => 'nullable|exists:villages,code',
'name' => 'required',
'address' => 'nullable|string',
'postal_code' => 'nullable|string|max:10',
'status' => 'nullable|boolean',
];
return $rules;
}
/**
* Determine if the user is authorized to make this request.
*/
public function authorize()
: bool
{
return true;
}
}