| 12345678910111213141516171819202122232425262728 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- class RoyaltiesBaseBracketRequest extends FormRequest
- {
- public function rules(): array
- {
- return [
- '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 [
- '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.',
- ];
- }
- }
|