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