Writeoff/Http/Requests/DetailJaminan/StoreDetailJaminanRequest.php

49 lines
1.2 KiB
PHP
Raw Permalink Normal View History

<?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 [
2023-12-26 06:34:47 +00:00
'kode' => 'nullable',
2023-12-15 06:41:12 +00:00
'nomor_pinjaman' => 'nullable',
'guarantee_type_id' => 'required',
2023-12-15 06:41:12 +00:00
'nomor_jaminan' => 'nullable',
'nilai_jaminan' => 'nullable|numeric',
2023-12-15 09:20:16 +00:00
'status' => 'nullable',
];
}
2023-12-26 06:34:47 +00:00
public function ignored()
: string
{
return $this->id;
}
2023-12-15 06:41:12 +00:00
protected function prepareForValidation()
{
$this->merge([
2023-12-26 06:34:47 +00:00
'kode' => round(microtime(true) * 100),
2023-12-15 06:41:12 +00:00
]);
}
}