PHPackages                             inspheric/nova-url-field - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. inspheric/nova-url-field

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

inspheric/nova-url-field
========================

A Laravel Nova URL field.

v3.0(1y ago)1031.3M↑15.5%19[2 issues](https://github.com/inspheric/nova-url-field/issues)1MITPHPPHP ^8.1

Since Aug 27Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/inspheric/nova-url-field)[ Packagist](https://packagist.org/packages/inspheric/nova-url-field)[ RSS](/packages/inspheric-nova-url-field/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (17)Used By (1)

Laravel Nova URL Field
======================

[](#laravel-nova-url-field)

A better URL input and link field for Laravel Nova. ***Version 2.0 now supports Nova 4.0 and Vue 3.0!***

[![Latest Version on Packagist](https://camo.githubusercontent.com/bc959f8f8303ab490c49a49b37a27b1624c252d751e9b973784450460d1551cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e737068657269632f6e6f76612d75726c2d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/inspheric/nova-url-field)[![Total Downloads](https://camo.githubusercontent.com/56705565ea4b51c752bdc801bff6f3a48ef9d20f0591743f3cfeb0821097399b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e737068657269632f6e6f76612d75726c2d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/inspheric/nova-url-field)

Installation
------------

[](#installation)

Install the package into a Laravel app that uses [Nova](https://nova.laravel.com) with Composer:

```
composer require inspheric/nova-url-field
```

Usage
-----

[](#usage)

Add the field to your resource in the `fields` method:

```
use Inspheric\Fields\Url;

Url::make('Homepage')
    ->rules('url', /* ... */),
```

The field extends the `Laravel\Nova\Fields\Text` field, so all the usual methods are available.

Supports readonly, placeholder and overriding the default `type="url"` if you prefer not to have the validation in the browser. This is from the standard Nova `Text` field so is not documented here.

It is recommended that you include the standard `url` and/or `active_url` validation rules, as they are not automatically added.

### Options

[](#options)

> ##### Terminology: label, title, value
>
> [](#terminology-label-title-value)
>
> The terms "label", "title" and "value" are used to describe the following options. They should be understood within the generated HTML as follows:
>
> ```
> {{ $label }}
> ```

#### Label

[](#label)

Make the field display with a label instead of the URL value itself on the detail or index pages:

```
Url::make('Homepage')
    ->label('External Link'),
```

You can, of course use the Laravel `trans()` or `__()` functions to translate the label.

The label is only displayed if the link is clickable, otherwise the URL value is displayed.

#### Label Using

[](#label-using)

Make the field display with a label using a callback:

```
Url::make('Homepage')
    ->labelUsing(function($value, $resource) {
        return $this->title;
    }),
```

The arguments `$value` and `$resource` are passed in the same way as the callback for `resolveUsing()`, but are optional.

#### HTML Label

[](#html-label)

If you would like to use custom HTML for the label, remember to also use the `asHtml()` option.

```
Url::make('Homepage')
    ->label('External Link')
    ->asHtml(),
```

#### Domain Label

[](#domain-label)

A shortcut method to display the domain part only of the URL (i.e. without `https?://www.`) as the label:

```
Url::make('Homepage')
    ->domainLabel(),
```

For example, the label for the field value `https://www.example.com/path?query=value&another=true#fragment` would display simply as `example.com`.

This is resolved after the `displayUsing()` callback if you have one, so if you modify the display of the URL in some way, the modified value will be passed to this label.

#### Name Label

[](#name-label)

A shortcut method to display the name of the field as the label:

```
Url::make('Homepage')
    ->nameLabel(),
```

The label would be displayed as `Homepage`.

#### Title

[](#title)

Set the link's title attribute, which will be displayed when the mouse hovers over it:

```
Url::make('Homepage')
    ->title('Link title'),
```

You can, of course use the Laravel `trans()` or `__()` functions to translate the label. If no custom title is set, the full URL value will be used.

The title is only used if the link is clickable.

#### Title Using

[](#title-using)

Set the title using a callback:

```
Url::make('Homepage')
    ->titleUsing(function($value, $resource) {
        return $this->title;
    }),
```

#### Clickable

[](#clickable)

Make the field display as a link on the detail page:

```
Url::make('Homepage')
    ->clickable(bool $clickable = true),
```

#### Clickable on Index

[](#clickable-on-index)

Make the field display as a link on the index page:

```
Url::make('Homepage')
    ->clickableOnIndex(bool $clickable = true),
```

#### Always Clickable

[](#always-clickable)

Combination of the two functions above for simplicity:

```
Url::make('Homepage')
    ->alwaysClickable(bool $clickable = true),
```

#### Open in Same Tab

[](#open-in-same-tab)

By default, the clickable link will open in a new tab (using `target="_blank"`). You can modify this behaviour so that the link opens in the same tab:

```
Url::make('Homepage')
    ->sameTab(bool $sameTab = true),
```

#### `rel=noopener` and `rel=noreferrer`

[](#relnoopener-and-relnoreferrer)

By default, a clickable link will open in a new tab and will have the `rel=noopener` attribute set\*. If you use `sameTab()` as above, `rel=noopener` will be unset.

To override the default behaviour, you can choose to set or unset `rel=noopener` and/or `rel=noreferrer` with the following methods:

```
Url::make('Homepage')
    ->noopener(bool $noopener = true),

Url::make('Homepage')
    ->noreferrer(bool $noreferrer = true),
```

If you use both `sameTab()` and `noopener()` on the same field, ensure that `noopener()` comes *after* `sameTab()` or the two settings will cancel each other out.

\* See [this article](https://mathiasbynens.github.io/rel-noopener/) for an explanation.

#### Custom HTML

[](#custom-html)

If you do not wish the link to be displayed with the default icon and text, you can set custom HTML which will replace the entire contents of the default template:

```
Url::make('Homepage')
    ->customHtml('Click here!'),
```

If the link is clickable, this content will be wrapped in an unstyled `` tag which implements all of the other options you have specified, such as `sameTab`, `title` etc.

If you *do* want the link to appear as link-styled text, you can add the classes `dim text-primary` within the HTML you specify.

**Important!** It is **your** responsibility to escape or sanitize any user-provided data before displaying it as raw HTML. This package does not do that for you.

#### Custom HTML Using

[](#custom-html-using)

Set the custom HTML using a callback:

```
Url::make('Homepage')
    ->customHtmlUsing(function($value, $resource, $label) {
        return view('partials.link_text', [
            'url'   => $value,
            'label' => $label,
        ])->render();
    }),
```

Note that the callback has a third argument `$label`, which will contain the appropriate label based on which of the `label()`, `labelUsing()`, `nameLabel()`, `domainLabel()` etc. options you have set on the field.

Remember that if the link is clickable, the custom HTML you specify is already wrapped in an `` tag, so you should not include an `` tag in your own custom HTML.

Appearance
----------

[](#appearance)

### Index (default)

[](#index-default)

[![index-field](docs/index-field.png)](docs/index-field.png)

The field is displayed as a plain `` element.

### Index (clickable)

[](#index-clickable)

[![index-field-clickable](docs/index-field-clickable.png)](docs/index-field-clickable.png)

The field is displayed as an `` element with an icon.

### Index (clickable with label)

[](#index-clickable-with-label)

[![index-field-clickable-label](docs/index-field-clickable-label.png)](docs/index-field-clickable-label.png)

The field is displayed as an `` element with an icon and a custom label.

### Detail (default)

[](#detail-default)

[![detail-field](docs/detail-field-plain.png)](docs/detail-field-plain.png)

The field is displayed as a plain `` element.

### Detail (clickable)

[](#detail-clickable)

[![detail-field-clickable](docs/detail-field-clickable.png)](docs/detail-field-clickable.png)

The field is displayed as an `` element with an icon.

### Detail (clickable with label)

[](#detail-clickable-with-label)

[![detail-field-clickable-label](docs/detail-field-clickable-label.png)](docs/detail-field-clickable-label.png)

The field is displayed as an `` element with an icon and a custom label.

### Form

[](#form)

[![form-field](docs/form-field.png)](docs/form-field.png)

The field is displayed as an `` element.

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance52

Moderate activity, may be stable

Popularity54

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 91.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~199 days

Recently: every ~452 days

Total

13

Last Release

435d ago

Major Versions

v1.4.2 → v2.02022-07-30

v2.0.2 → v3.02025-03-10

PHP version history (3 changes)v1.0PHP &gt;=7.1.0

v2.0PHP ^8.0

v3.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/f364bd82fe8c6144a74ee2b6bce92be53b8833f31fef37863e863e2dccdf07f6?d=identicon)[inspheric](/maintainers/inspheric)

---

Top Contributors

[![kitbs](https://avatars.githubusercontent.com/u/4569320?v=4)](https://github.com/kitbs "kitbs (51 commits)")[![den1n](https://avatars.githubusercontent.com/u/25498109?v=4)](https://github.com/den1n "den1n (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![kwidoo](https://avatars.githubusercontent.com/u/14920653?v=4)](https://github.com/kwidoo "kwidoo (1 commits)")[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (1 commits)")[![tzsk](https://avatars.githubusercontent.com/u/13273787?v=4)](https://github.com/tzsk "tzsk (1 commits)")

---

Tags

laravellaravel-novalaravel-nova-fieldlaravel-packagenovaurllaravelfieldnova

### Embed Badge

![Health badge](/badges/inspheric-nova-url-field/health.svg)

```
[![Health](https://phpackages.com/badges/inspheric-nova-url-field/health.svg)](https://phpackages.com/packages/inspheric-nova-url-field)
```

###  Alternatives

[alexwenzel/nova-dependency-container

A Laravel Nova 4 form container for grouping fields that depend on other field values.

461.0M2](/packages/alexwenzel-nova-dependency-container)[outl1ne/nova-simple-repeatable

A Laravel Nova simple repeatable rows field.

74356.3k](/packages/outl1ne-nova-simple-repeatable)[simplesquid/nova-enum-field

A Laravel Nova field to add enums to resources.

52391.9k2](/packages/simplesquid-nova-enum-field)[sietse85/nova-button

(Nova 4+) A Laravel Nova package for adding buttons to your resources.

37347.3k](/packages/sietse85-nova-button)[optimistdigital/nova-notes-field

This Laravel Nova package adds a notes field to Nova's arsenal of fields.

52139.5k](/packages/optimistdigital-nova-notes-field)[outl1ne/nova-color-field

A Laravel Nova Color Picker field.

26249.4k](/packages/outl1ne-nova-color-field)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
