any way to customize validationMessages for a checkbox?

                Checkbox::make('has_agreed_to_tos')
                    ->accepted()
                    ->required()
                    ->label(fn () => new HtmlString('I agree to the <a href="#"  target="_blank" class="fi-link group/link relative inline-flex items-center justify-center outline-none fi-size-md fi-link-size-md text-sky-500 text-underline">Terms & Conditions</a> and <a href="#" target="_blank" class="fi-link group/link relative inline-flex items-center justify-center outline-none fi-size-md fi-link-size-md text-sky-500 text-underline">Privacy Policy</a>'))
                    ->validationMessages([
                        'accepted' => 'You must agree to the terms and conditions to continue.',
                        'required' => 'test'
                    ])
            ])

tried both required and accepted separately and together and it always posts the entire content of the label attribute as the error message on the UI, which is obviously not great.

Maybe using label isn't the right approach?
Solution
remove $this->validate();
Was this page helpful?