定制 upline/nova-link-field 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

upline/nova-link-field

最新稳定版本:1.0.0

Composer 安装命令:

composer require upline/nova-link-field

包简介

A Laravel Nova field.

README 文档

README

composer require upline/nova-link-field
  • Link is displayed as a resource link in the index and detail views.
  • In forms, the link is shown as a text input.

Usage

use Upline\NovaLinkField\Link; class User extends Resource { // ... public function fields(NovaRequest $request) { return [ // ... Link::make('Instagram') // Get link from instagram model field ->text(fn() => 'Instagram link') // Set static anchor  ->target('_blank') // Set target attribute ]; } }
use Upline\NovaLinkField\Link; class User extends Resource { // ... public function fields(NovaRequest $request) { return [ // ... Link::make('Instagram', fn($resource) => 'https://instagram.com/' . $resource->instagramId) // Compute link ->text('instagram_username') // Use instagram_username field as anchor text ->target('_blank') ]; } }

Why it is better than formatting text as link

In this example we don't escape $username, so we can get some security troubles.

Text::make('Twitter Profile', function () { $username = $this->twitterUsername; return "<a href='https://twitter.com/{$username}'>@{$username}</a>"; })->asHtml(), 

Same, using this package:

Link::make('Twitter Profile', function () { $username = $this->twitterUsername; return "https://twitter.com/{$username}"; })->text('username'), 

However, in this case link and username will be escaped. If you need to use html in anchor text, you still can use asHtml() method.

统计信息

  • 总下载量: 18.38k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固