35 lines
759 B
PHP
35 lines
759 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Api;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class AbsenRequest 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|string',
|
|
'bukti' => 'required|file|mimes:pdf|max:1024',
|
|
'keterangan' => 'required|string',
|
|
'kategori' => 'required|integer',
|
|
'tanggal' => 'required|date|date_format:Y-m-d|before_or_equal:' . date('Y-m-d'),
|
|
];
|
|
}
|
|
}
|