52 lines
1.4 KiB
PHP
52 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Modules\Writeoff\Http\Requests\DetailJaminan;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Http\Exceptions\HttpResponseException;
|
|
use Illuminate\Validation\ValidationException;
|
|
use Illuminate\Validation\Validator;
|
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
|
|
|
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 [
|
|
'id_detail_jaminan' => '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([
|
|
'id_detail_jaminan' => round(microtime(true) * 100),
|
|
]);
|
|
}
|
|
}
|