27 lines
704 B
PHP
27 lines
704 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests\Approval;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
|
||
|
|
class DelegationStoreRequest extends FormRequest
|
||
|
|
{
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function rules(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'delegate_id' => 'required|integer|exists:users,id',
|
||
|
|
'start_date' => 'required|date|after_or_equal:today',
|
||
|
|
'end_date' => 'required|date|after_or_equal:start_date',
|
||
|
|
'form_ids' => 'nullable|array',
|
||
|
|
'form_ids.*' => 'integer|exists:approval_forms,id',
|
||
|
|
'notify_delegator' => 'nullable|boolean',
|
||
|
|
'reason' => 'nullable|string|max:500',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|