定制 alitnk/nova-parental-field 二次开发

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

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

alitnk/nova-parental-field

Composer 安装命令:

composer require alitnk/nova-parental-field

包简介

A Laravel Nova field for single-table inheritance (Caleb Porzio's "Parental" package)

README 文档

README

A Laravel Nova field made for Parental to quickly make a select element to choose the child type

Installation

composer require alitnk/nova-parental-field

Usage

use Wama\NovaParentalField\Parental;

 public function fields(Request $request)
    {
        return [
            // ... your other fields
            
            Parental::make()->searchable(),
        ];
    }

The parental field extends Nova's select field. so you can make use of methods like searchable() on it.

Passing the field's name is optional, the package will automatically get the field name based on your $childColumn property and if there is none, it'll just default to type.

After making the field, it automatically gets the children types and populates them in the select field.

So, assuming your parent model looks like this:

class User extends Model {
    use HasChildren;

    private $childTypes = [
        'admin' => Admin::class,
        'moderator' => Moderator::class,
        'author' => Author::class,
    ];
}

After you add the Parental::make()->searchable() to your Nova fields, you should get the following result:

nova-parental-field-1

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固