upline/nova-link-field
A Laravel Nova field that renders values as clickable links, letting you display URLs, emails, or custom targets directly in Nova resources and index views. Simple to configure and easy to drop into any Nova fieldset, it turns plain text into actionable links with minimal setup.
Minimal setup:
composer require upline/nova-link-field
Then inspect the package source/README before wiring it up, since this is a very small package and the exact field class/API matters:
cat vendor/upline/nova-link-field/README.md
ls vendor/upline/nova-link-field/src
Add the field to a Nova resource. Adjust the class name to match the package source:
use Upline\NovaLinkField\LinkField;
public function fields(NovaRequest $request): array
{
return [
LinkField::make('Website', 'website')
->rules('nullable', 'url')
->sortable(),
];
}
First use case: show a clickable website/vendor/documentation URL in a Nova resource index or detail page without exposing the raw URL as editable text. Treat this as display sugar: the underlying column is still a normal string/URL column in your model.
Where to look first:
README.md for the package’s supported field name and fluent methods.src/ for the Nova field class, meta(), resolve(), and any custom methods.resources/js/ for the Vue component behavior, especially how it builds the href and label.Use it as a read-only display field alongside a normal editable field when editors need to change the URL:
Text::make('Website', 'website')
->rules('nullable', 'url')
->hideFromIndex(),
LinkField::make('Website', 'website')
->onlyOnIndex()
->rules('nullable', 'url'),
Show a friendlier label while linking to the stored URL:
LinkField::make('Website', 'website')
->displayUsing(fn ($value) => $value ? parse_url($value, PHP_URL_HOST) : '—')
->nullable(),
Use Nova visibility helpers to avoid cluttering forms:
LinkField::make('Documentation', 'docs_url')
->onlyOnDetail()
->rules('nullable', 'url');
For computed or non-HTTP links such as mailto: or tel:, do not blindly apply the url rule; use a custom validation rule and confirm the Vue component renders the scheme correctly.
If the package supports target-window configuration, prefer opening external links in a new tab with safe attributes. If not, keep links in the same tab or extend the field’s Vue component.
Recommended day-to-day workflow:
Text/URL field for forms.LinkField only on index/detail views.vendor/upline/nova-link-field/src is the source of truth.Nova::script()/Nova::style() and confirm the compiled assets exist.null; use ->nullable() and a fallback label.javascript: and similar schemes; the url rule helps, but test edge cases.displayUsing(), confirm the callback affects only the visible label, not the actual href. Test in Nova’s index and detail views.meta() payload and the stored resource value.URL field first. This package is worth using only when its rendering behavior saves you from writing a custom field.How can I help you explore Laravel packages today?