| 1234567891011121314151617181920212223 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- class SupportTicketRequest extends FormRequest
- {
- public function rules(): array
- {
- $isUpdate = $this->isMethod('PUT') || $this->isMethod('PATCH');
- return [
- 'title' => ($isUpdate ? 'sometimes' : 'required') . '|string|max:255',
- 'severity' => ($isUpdate ? 'sometimes' : 'required') . '|string|in:alta,normal,baixa',
- 'scope' => ($isUpdate ? 'sometimes' : 'required') . '|string|in:all,internal,specific',
- 'target_unit_id' => 'nullable|integer|exists:units,id',
- 'sector' => 'nullable|string|max:255',
- 'description' => 'nullable|string',
- 'status' => 'sometimes|string|in:in_progress,resolved,unresolved',
- ];
- }
- }
|