carlson/nova-link-field
A Laravel Nova field that renders a clickable link directly in your resource index and detail views. Pair a display label with a target URL, optionally open in a new tab, and skip raw HTML or custom components for simple link display.
<a href> in Nova's index and detail views. It does not add storage, sync, or business logic. The decision it informs is narrow — "do we spend effort making operator screens nicer this sprint, or not?" — and it should be prioritized against other internal-tooling items, not against customer features.Field subclass plus a Vue component that renders an anchor, roughly 60–120 lines. With 22 stars, zero dependents, and no release since February 2020, "adopt the package" actually means "vendor someone else's 2020-era code and own it forever." Frame the choice as half a day writing a first-party field vs. copying ~100 lines into our repo — not as add a dependency. That reframing is the decision, and it's a cheap one either way.Consider it when all of the following hold:
Text field for editing (onlyOnForms() / exceptOnForms()) so operators still get a plain input box when pasting URLs.http, https, mailto) on save, and render with an escaped :href binding plus rel="noopener noreferrer" whenever target="_blank".Look elsewhere — or skip it — when:
src/Link.php and the two .vue files as a specification and reimplement; you'll get the same behavior with no dead dependency.To executives (60 seconds): This is a small internal admin-panel polish item, not a product feature. It makes URLs stored in our database clickable inside our admin tool, so support and content staff can jump to the external record instead of copying and pasting it. Cost is roughly half a day of engineering. There is no customer-facing change, no revenue impact, and no new vendor relationship we need to manage — the package itself is unmaintained, so we'd copy the code into our own repo rather than depend on it. Recommended: fold it into existing admin work if we're already in that area; otherwise defer. It's a "yes, cheap" or "yes, later," never a roadmap line.
To engineering (the framing that gets a clean build): Don't composer require this on a modern stack. The last release is February 2020 — Nova 2/3, Vue 2, Laravel Mix era — and there are zero dependents, meaning nobody has tested it against a Nova upgrade. Two viable paths, both under a day:
app/Nova/Fields/Link) and use it as a starting point, adding a scheme allowlist, rel="noopener noreferrer", and a feature test asserting hostile input (javascript:, data:, quote-breaking payloads) is escaped.php artisan nova:field acme/link) and port the behavior from the source. Roughly 60–120 lines; we own upgrades in one place.Either way: read src/Link.php before trusting any README snippet (setter names like text(), target(), openInNewTab() vary), confirm dist/js/field.js is committed, and roll out one resource at a time — the break mode is a silently blank column, so staging-check each resource before widening.
The one-line risk statement: a link field is a textbook stored-XSS surface in an admin panel. Treat the href as hostile input even when the data is "obviously" internal — validate the scheme on save, bind with :href (never v-html), and add rel="noopener noreferrer" on every outbound link. That's a small, one-time hardening cost we should budget into the same half-day.
How can I help you explore Laravel packages today?