['required', 'string'], 'domain_name' => ['required', 'string', 'max:255'], 'years' => ['nullable', 'integer', 'min:1', 'max:3'], ]; } /** Default years to 1 if omitted. */ protected function prepareForValidation(): void { if (!$this->has('years') || $this->years === null) { $this->merge(['years' => 1]); } } }