41 lines
1.0 KiB
PHP
41 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Modules\Lpj\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class PenilaianRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'jenis_penilaian_id' => 'required|max:255',
|
|
'teams_id' => 'required|max:255',
|
|
'user_id' => 'required|max:255',
|
|
'tanggal_kunjungan' => 'required|max:255',
|
|
'status' => 'required|max:10',
|
|
'keterangan' => 'nullable',
|
|
'permohonan_id' => 'required',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
protected function prepareForValidation()
|
|
{
|
|
// Menetapkan nilai default untuk 'status' jika tidak ada dalam request
|
|
$this->merge([
|
|
'status' => $this->status ?? 'assign',
|
|
]);
|
|
}
|
|
}
|