F
Filament8mo ago
ericmp

How to modify Toggle so I can add a link

I want the text "the privacy policy" to be a hyperlink. How can i achieve it?
Forms\Components\Toggle::make('accepts_privacy_policy')
->label(__('I accept the privacy policy'))
Forms\Components\Toggle::make('accepts_privacy_policy')
->label(__('I accept the privacy policy'))
(I was trying:
// ->state(function () {
// return new HtmlString(
// '<a href="#">test</a>'
// );
// })
// ->state(function () {
// return new HtmlString(
// '<a href="#">test</a>'
// );
// })
)
No description
9 Replies
toeknee
toeknee8mo ago
->label( new HtmlString('<a href="my_link">' . __('I accept the privacy policy') . '</a>')
->label( new HtmlString('<a href="my_link">' . __('I accept the privacy policy') . '</a>')
ericmp
ericmpOP8mo ago
dont ask me why i was trying it in the state fn 🤦 thanks @toeknee ^^
ericmp
ericmpOP8mo ago
hmm what would u do now?
No description
ericmp
ericmpOP8mo ago
i think this should be easier to setup since this is the typical accept terms btn and im struggling kinda hard with it also, i dont understand why it lowercases I've read to i've read
toeknee
toeknee8mo ago
Customise the error message too
ericmp
ericmpOP8mo ago
no way let me search the docs sorry
toeknee
toeknee8mo ago
->validationMessages([
'required' => 'Please confirm you have read the Privacy Policy.',
])
->validationMessages([
'required' => 'Please confirm you have read the Privacy Policy.',
])
ericmp
ericmpOP8mo ago
thanks again
Want results from more Discord servers?
Add your server