| 12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- class FranchiseeFnmBracketRequest extends FormRequest
- {
- public function rules(): array
- {
- return [
- 'franchisee_id' => ['required', 'integer', 'exists:franchisees,id'],
- 'description' => ['required', 'string', 'max:150'],
- 'start_month' => ['required', 'integer', 'min:1'],
- 'end_month' => ['nullable', 'integer', 'min:1', 'gte:start_month'],
- 'percentage' => ['required', 'numeric', 'min:0', 'max:1'],
- ];
- }
- public function messages(): array
- {
- return [
- 'franchisee_id.required' => 'O franqueado é obrigatório.',
- 'franchisee_id.exists' => 'Franqueado não encontrado.',
- 'description.required' => 'A descrição é obrigatória.',
- 'start_month.required' => 'O mês inicial é obrigatório.',
- 'end_month.gte' => 'O mês final deve ser maior ou igual ao mês inicial.',
- 'percentage.required' => 'O percentual é obrigatório.',
- ];
- }
- }
|