Laravel Nova icon Nova Packages
E

External URL Field

Installation Instructions

Nova External URL Field

Adds the ability to show external URLs in the detail and index views of resources. It uses the resolving feature from Nova to generate links.

It will show up in the detail view like this:

And in the index view like this:

Installation and usage

You can require this package using composer:

composer require pdewit/nova-external-url

You can add the field with a resolver as follows:

use Pdewit\ExternalUrl\ExternalUrl;

ExternalUrl::make('Google Link', function () {
    return 'https://www.google.com/search?q=' . $this->name;
}),

Customising the displayed text

You can customise the displayed text using the linkText function like so:

use Pdewit\ExternalUrl\ExternalUrl;

ExternalUrl::make('Google Link', function () {
    return 'https://www.google.com/search?q=' . $this->name;
})->linkText($this->name),

Readme

Nova External URL Field

Adds the ability to show external URLs in the detail and index views of resources. It uses the resolving feature from Nova to generate links.

It will show up in the detail view like this:

And in the index view like this:

Installation and usage

You can require this package using composer:

composer require pdewit/nova-external-url

You can add the field with a resolver as follows:

use Pdewit\ExternalUrl\ExternalUrl;

ExternalUrl::make('Google Link', function () {
    return 'https://www.google.com/search?q=' . $this->name;
}),

Customising the displayed text

You can customise the displayed text using the linkText function like so:

use Pdewit\ExternalUrl\ExternalUrl;

ExternalUrl::make('Google Link', function () {
    return 'https://www.google.com/search?q=' . $this->name;
})->linkText($this->name),

The label below the link normally shows the URL, but it can be overridden:

use Pdewit\ExternalUrl\ExternalUrl;

ExternalUrl::make('Google Link', function () {
    return 'https://www.google.com/search?q=' . $this->name;
})->labelText('View search results on Google'),
Back to Top
Added 6 years ago
Last updated 6 Years Ago
Version 1.0.3
Composer
pdewit/nova-external-url
GitHub stars 31
Packagist downloads 332,590

Favorites

17 users favorited

Rating

5.00
(out of 5)
★★★★★
★★★★
★★★
★★
7 ratings

Contributors

Tags

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas