44 lines
956 B
PHP
44 lines
956 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Api\Jabatan;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class NipRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'nip' => 'required|numeric',
|
|
'sk' => 'required|file|mimes:pdf|max:2048',
|
|
];
|
|
}
|
|
|
|
public function messages()
|
|
{
|
|
return [
|
|
'nip.required' => 'NIP harus diisi',
|
|
'nip.numeric' => 'NIP harus berupa angka',
|
|
'sk.required' => 'SK harus diisi',
|
|
'sk.file' => 'SK harus berupa file',
|
|
'sk.mimes' => 'SK harus berupa file pdf',
|
|
'sk.max' => 'Ukuran file maksimal 1 MB',
|
|
];
|
|
}
|
|
}
|