Feature #15 : Pemilik Jaminan

This commit is contained in:
Daeng Deni Mardaeni
2024-08-22 14:52:36 +07:00
parent 0bdade3456
commit 3fc9e8fd0c
12 changed files with 743 additions and 7 deletions

View File

@@ -13,6 +13,7 @@
: array
{
$rules = [
'debiture_id' => 'required|exists:debtures,id',
'pemilik_jaminan_id' => 'required',
'jenis_jaminan_id' => 'required',
'jenis_legalitas_jaminan_id' => 'required',

View File

@@ -0,0 +1,44 @@
<?php
namespace Modules\Lpj\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class PemilikJaminanRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules()
: array
{
$rules = [
'debiture_id' => 'required|exists:debitures,id',
'npwp' => 'nullable|string|max:16',
'email' => 'nullable|email|max:100',
'phone' => 'nullable|string|max:20',
'hubungan_pemilik_jaminan_id' => 'nullable|exists:hubungan_pemilik_jaminan,id',
'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',
];
$rules['nomor_id'] = 'nullable|max:16|unique:pemilik_jaminan,nomor_id,debiture_id,' . $this->debiture_id;
return $rules;
}
/**
* Determine if the user is authorized to make this request.
*/
public function authorize()
: bool
{
return true;
}
}