51 lines
1.4 KiB
PHP
51 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Modules\Writeoff\Http\Requests\DetailPembayaran;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Http\Exceptions\HttpResponseException;
|
|
use Illuminate\Validation\ValidationException;
|
|
use Illuminate\Validation\Validator;
|
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
|
|
|
class StoreDetailPembayaranRequest 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 [
|
|
'nomor_pinjaman' => 'nullable|string',
|
|
'tanggal_pembayaran'=> 'required|date',
|
|
'nominal' => 'required|numeric',
|
|
'keterangan' => 'nullable|string',
|
|
'status' => 'nullable',
|
|
];
|
|
}
|
|
|
|
public function ignored(): string
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
protected function prepareForValidation()
|
|
{
|
|
$this->merge([
|
|
'nomor_pinjaman' => $_SESSION['nomor_pinjaman'],
|
|
]);
|
|
}
|
|
}
|