定制 konsulting/nova-target 二次开发

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

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

konsulting/nova-target

最新稳定版本:1.0.2

Composer 安装命令:

composer require konsulting/nova-target

包简介

Target elements to hide or adjust classes in Laravel Nova resources

README 文档

README

Target elements to hide or adjust classes in Laravel Nova resources

NovaTarget is a Laravel Nova 4 field, that is hidden and utilised to target and alter HTML DOM elements. It has been kept intentionally simple.

For quite a while we looked for a way to hide the 'Create and Add Another' and 'Update and Continue Editing' buttons for some resources. The only solution seen was to add some global CSS to always hide the buttons based on the Dusk selector.

This package essentially builds on that but utilises a field on the Resource page(s) so the CSS is targeted (as it only appears when the field is used).

Following simple hiding, we have added the ability to alter, or replace classes on elements too, such as re-colouring a button.

To install, simply:

 composer require konsulting/nova-target:^1.0 

To use, simply add the field to the form and called one of the following methods.

\Konsulting\NovaTarget\NovaTarget::make('') ->hideCreateAndAddAnotherButton()
\Konsulting\NovaTarget\NovaTarget::make('') ->hideUpdateAndContinueEditingButton()
\Konsulting\NovaTarget\NovaTarget::make('') // ->replaceElementClass($cssSelector, $newClasses) ->replaceElementClass('[dusk=update-and-continue-editing-button]', 'bg-red-500')
\Konsulting\NovaTarget\NovaTarget::make('') // ->adjustElementClass($cssSelector, $removeClasses, $addClasses) ->adjustElementClass('[dusk=update-and-continue-editing-button]', 'bg-primary-500 hover:bg-primary-400 ring-primary-200', 'bg-gray-500 hover:bg-gray-400 ring-gray-200')

We are happy to receive contributions to this package.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固