nikans/text-linked

索引上的文本字段带有链接(例如,指向此资源)

1.0.0 2021-03-20 14:18 UTC

This package is auto-updated.

Last update: 2024-09-20 22:18:03 UTC


README

Nova自定义文本字段,在索引屏幕上链接到资源(或任何URL)。

Nova默认将ID字段链接到资源。如果你使用的是文本ID字段或想要链接资源的标题,如下所示,自定义字段非常有用。

Nova TextLinked Field Example

该字段在详情和表单屏幕上的行为与默认文本字段相同。

安装

composer require nikans/text-linked

使用选项

自动将资源链接到标题或文本ID字段

TextLinked::make('Title', 'title')
    ->link($this),
    
TextLinked::make('ID')
    ->link($this),

通过uriKeyid链接资源

TextLinked::make('Title', 'title')
    ->linkResource($this->uriKey(), $this->id),

添加随机URL

TextLinked::make('ID')
    ->url("https://novapackages.com"),