Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Nova Text Linked Field Laravel Package

lednerb/nova-text-linked-field

A Laravel Nova field that displays plain text as a clickable hyperlink, letting you turn any attribute into a link on index and detail views without custom components. Useful for referencing external records, dashboards, or related resources directly from your Nova admin panel.

View on GitHub
Deep Wiki
Context7

Getting Started

The package is a Laravel Nova field extension, so the first step is confirming Nova is installed and your app is on a compatible Nova major version. Install via Composer (composer require <vendor>/<package>) and let Nova’s field discovery pick it up; no service provider registration is needed in most Nova packages, but check the README if the package ships a config file you need to publish.

Where to look first:

  • The field class itself (src/…Field.php) for the public setter methods added in v1.1.0 (trimming and target/tooltip options).
  • The Nova resource where you intend to use it, since this field is configured fluently at the resource level, not globally.
  • The compiled JS/dist assets if you need to verify tooltip or target="_blank" behaviour in the browser.

First use case: add the field to a Nova resource and enable the new v1.1.0 options:

use Vendor\Package\Field;

public function fields(Request $request)
{
    return [
        Field::make('Website')
            ->trim(50)                 // truncate long input display
            ->tooltip('Full URL shown on hover')
            ->target('_blank'),        // open links in a new tab
    ];
}

If you only need the default behaviour, Field::make('Website') alone should still work — the v1.1.0 additions are opt-in.

Implementation Patterns

Resource-level configuration. Treat this field like any other Nova field: configure trimming, tooltip text, and link target directly in fields(). Keep these settings per-resource so different models can present the same underlying column differently.

Trimming for index views. The trim feature is most useful on index/detail views where long URLs or text would break table layout. Pair a trimmed display with a tooltip so users can still see the full value:

Field::make('Homepage')
    ->trim(40)
    ->tooltip(fn ($value) => $value)  // or a static string
    ->target('_blank')
    ->onlyOnIndex(),

Target handling for external links. Use ->target('_blank') for anything leaving your app (external URLs, docs, partner sites). For internal Nova links, keep the default target to avoid orphaned tabs. If the package exposes a boolean helper instead of a string target, prefer that for readability.

Tooltip content strategy. Static tooltips are fine for fixed labels, but for long inputs the tooltip is most valuable when it shows the untruncated value. If the package supports a closure or the raw attribute, use it so the tooltip and the trimmed display stay in sync automatically.

Workflow for upgrading an existing resource. When retrofitting v1.1.0 onto an existing field, add options incrementally: first ->trim(...), verify layout on index, then layer ->tooltip(...) and ->target(...). This keeps it obvious which option caused any rendering regression.

Composition with Nova’s built-in helpers. Combine with ->sortable(), ->rules(), or ->hideFromIndex() as usual — the new options are display-layer only and should not affect validation or persistence.

Gotchas and Tips

Trimming is presentation-only. ->trim() almost certainly truncates the displayed string, not the stored value. Do not rely on it to enforce length; keep database column limits and validation rules as the source of truth.

Tooltip escaping. If tooltip text is derived from user-controlled input (URLs, titles), confirm the package escapes HTML. A tooltip rendered via innerHTML with an unescaped attribute is an XSS vector in the Nova UI. Test with a value containing <script> or quotes.

Target attribute and Nova navigation. target="_blank" on a field that Nova uses for internal navigation (e.g., a detail link) can feel broken. Apply it only to genuinely external links, and double-check whether the package applies the target to the field wrapper or the anchor — the behaviour differs.

Version pinning. You’re on v1.1.0. Pin the constraint (^1.1) and keep an eye on the changelog; v1.1.0 removed unused code, which is usually harmless but occasionally drops a previously public helper. If you subclassed or called into the field’s internals, grep for removed methods before upgrading.

Asset rebuilds. Nova fields ship compiled JS. After upgrading, run php artisan nova:publish (or the package’s documented publish command) and hard-refresh the browser. Stale compiled assets are the most common cause of “the new option does nothing.”

Config quirks. If the package publishes a config file, note that published configs are not updated automatically on upgrade. Diff the package’s config/ against your published copy after any minor bump.

Extension points. If trimming/tooltip defaults don’t fit, the cleanest extension is a thin subclass of the field that sets your house defaults in the constructor, then reference that subclass in resources. Avoid editing vendor files — changes will be lost on the next composer update.

Debugging rendering issues. Use Nova’s browser devtools to inspect the rendered field wrapper; the tooltip and target attributes should appear as data attributes or on the anchor. If they’re absent, the fluent call likely isn’t reaching the field (check for a typo in the method name — Nova fields silently ignore unknown fluent calls in some versions via __call).

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager