https://github.com/nikans/text-linked
Nova custom Text Field with a link to a resource on index screen.
https://github.com/nikans/text-linked
nova nova-field
Last synced: 5 months ago
JSON representation
Nova custom Text Field with a link to a resource on index screen.
- Host: GitHub
- URL: https://github.com/nikans/text-linked
- Owner: nikans
- Created: 2021-03-20T13:32:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-11T06:37:56.000Z (about 5 years ago)
- Last Synced: 2026-01-02T09:26:11.608Z (6 months ago)
- Topics: nova, nova-field
- Language: PHP
- Homepage:
- Size: 280 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nova TextLinked custom field
Nova custom Text Field with a link to a resource (or any URL) on index screen.
Nova links ID fields to a resource by default.
The custom field is useful if you're using a [text ID field](https://github.com/laravel/nova-issues/issues/268)
or want to **link a resource's title**, as shown below.

The field behaves just like the default text field on detail and form screens.
## Installation
```bash
composer require nikans/text-linked
```
## Usage options
### Automatically link a resource to a title or text ID field
```php
TextLinked::make('Title', 'title')
->link($this),
TextLinked::make('ID')
->link($this),
```
### Link a resource by `uriKey` and `id`
```php
TextLinked::make('Title', 'title')
->linkResource($this->uriKey(), $this->id),
```
### Add a random URL
```php
TextLinked::make('ID')
->url("https://novapackages.com"),
```