Tricks

Add a link to field hint() and helperText()

Aug 9, 2022
Andrew Peacock
Admin panel, Form builder

The hint() and helperText() functions support markdown, so you just need to add the link in Markdown format.

However, Laravel markdown does not support relative links, so if you need a link that works in different environments, you need to build that URL using Laravel's url() function:

TextInput::make("cost")
->suffix(auth()->user()->settings()->get("currency", "USD"))
->hint("[Change currency](" . url("/settings") . ")"),

No comments yet…