| 1234567891011121314151617181920212223242526 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- class KanbanRequest extends FormRequest
- {
- public function rules(): array
- {
- $isUpdate = $this->isMethod('PUT') || $this->isMethod('PATCH');
- $sometimes = $isUpdate ? 'sometimes' : 'required';
- return [
- 'title' => "{$sometimes}|string|max:255",
- 'priority' => "{$sometimes}|string|in:alta,normal,baixa",
- 'phase' => "{$sometimes}|string|in:a_fazer,em_progresso,em_revisao,concluido,demandas_especiais",
- 'scope' => "{$sometimes}|string|in:internal,all,specific",
- 'responsible_user_id' => 'nullable|integer|exists:users,id',
- 'target_unit_id' => 'nullable|integer|exists:units,id',
- 'sector' => 'nullable|string|max:255',
- 'due_date' => 'nullable|date',
- 'description' => 'nullable|string',
- ];
- }
- }
|