49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Modules\Writeoff\Http\Requests\DetailJaminan;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreDetailJaminanRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize()
|
|
: bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
|
*/
|
|
public function rules()
|
|
: array
|
|
{
|
|
return [
|
|
'kode' => 'nullable',
|
|
'nomor_pinjaman' => 'nullable',
|
|
'guarantee_type_id' => 'required',
|
|
'nomor_jaminan' => 'nullable',
|
|
'nilai_jaminan' => 'nullable|numeric',
|
|
'status' => 'nullable',
|
|
];
|
|
}
|
|
|
|
public function ignored()
|
|
: string
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
protected function prepareForValidation()
|
|
{
|
|
$this->merge([
|
|
'kode' => round(microtime(true) * 100),
|
|
]);
|
|
}
|
|
}
|