pdmfc/nova-inline-text 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

pdmfc/nova-inline-text

最新稳定版本:v1.2.1

Composer 安装命令:

composer require pdmfc/nova-inline-text

包简介

A Laravel Nova inline text field.

README 文档

README

Version Total Downloads License

This package lets you edit text fields directly on your resources pages.

Installation

composer require pdmfc/nova-inline-text

Usage

use Pdmfc\NovaFields\InlineText; //... public function fields() { return [ InlineText::make('Name'), ]; }

Making it editable

By default, this field behaves like a regular text field. To be able to edit it on the index page, use the inlineOnIndex() method:

public function fields() { return [ InlineText::make('Name') ->inlineOnIndex(), ]; }

Basic usage

This method also accepts a closure with the current request if you want to make it editable dynamically:

public function fields() { return [ InlineText::make('Name') ->inlineOnIndex(function (NovaRequest $request) { return $request->user()->isAdmin(); }), ]; }

Updating field value

The default trigger to save the value is by pressing the Enter key (keyup.enter). If you wish to use a different event trigger to update the value you can use the saveOn() method that accepts an argument corresponding to a javascript event:

public function fields() { return [ InlineText::make('Name') ->inlineOnIndex() ->saveOn('blur'), ]; }

Key event modifiers

You can also specify the key event modifier:

public function fields() { return [ InlineText::make('Name') ->inlineOnIndex() ->saveOn('keyup.shift'), ]; }

Refreshing resource table

When saving the current field value, it will not refresh the table. If you need this functionality, use the refreshOnSaving() method:

public function fields() { return [ InlineText::make('Name') ->inlineOnIndex() ->refreshOnSaving(), ]; }

⚠️ Caveats

  • When updating the field, make sure you add the sometimes validation rule to the rest of the fields that are required:

    Text::make('Email') ->rules('required', 'email') ->updateRules('sometimes') // Add these method call and validation rule to the fields that are required

How to contribute

  • clone the repo
  • on composer.json of a laravel nova application add the following:
{ //... "require" { "pdmfc/nova-inline-text: "*" }, //... "repositories": [ { "type": "path", "url": "../path_to_your_package_folder" } ], } 
  • run composer update pdmfc/nova-inline-text

You're now ready to start contributing!

统计信息

  • 总下载量: 48.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 8
  • 开发语言: Vue

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固