定制 formfeed-uk/nova-subfield-dependson 二次开发

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

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

formfeed-uk/nova-subfield-dependson

最新稳定版本:2.0.3

Composer 安装命令:

composer require formfeed-uk/nova-subfield-dependson

包简介

Functionality to allow fields which are contained within other fields to use Nova DependsOn

README 文档

README

This Laravel Nova package includes an interface and middleware to allow fields that contain subfields (such as Dependable Panel, or Flexible Content) to allow those subfields to use the dependsOn functionality within Laravel Nova 4.

As long as all fields that contain subfields implement the interface methods any subfield could be nested within any field to any depth.

Requirements

  • php: >=8.0
  • laravel/nova: ^4.0

Installation

  1. Install the package in to a Laravel app that uses Nova via composer:
composer require formfeed-uk/nova-subfield-dependson

Usage

Simply implement the included interface onto any Field you wish to allow subfields to use the dependsOn functionality

hasSubFields

    public function hasSubfields(): bool;

This method should return a boolean value to indicate whether the current instance of your field has subfields that require the dependsOn functionality.

getSubfields

    public function getSubfields(): FieldCollection;

This method should return a FieldCollection of the subfields that require the dependsOn functionality

afterDependsOnSync

    public function afterDependsOnSync() : self;

This method is run after any dependsOn sync where additional logic may be required. This may simply return $this; where no additional logic is required.

Known Issues

Due to how Nova's DependantComponentKey works If a field uses the same Class, Component, and Attribute as another subfield within the same request this could cause a collision, where the wrong field is found. An upcoming release will include a macro for Laravel\Nova\Fields\Field to allow you to set your own DependantComponentKey method.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-29