pdewit / nova-external-url by pdewit

An external URL Laravel Nova field.
320,934
31
2
Package Data
Maintainer Username: pdewit
Package Create Date: 2018-08-23
Package Last Update: 2022-02-08
Language: Vue
License: MIT
Last Refreshed: 2024-11-24 15:08:44
Package Statistics
Total Downloads: 320,934
Monthly Downloads: 1,837
Daily Downloads: 18
Total Stars: 31
Total Watchers: 2
Total Forks: 6
Total Open Issues: 5

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'),