承接 parfumix/nova-creatable-belongs-to 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

parfumix/nova-creatable-belongs-to

Composer 安装命令:

composer require parfumix/nova-creatable-belongs-to

包简介

BelongsTo field for laravel nova which allows to choose or create a resource

README 文档

README

BelongsTo Field for Laravel Nova which allows to choose or create a resource

Latest Stable Version Total Downloads Latest Unstable Version License StyleCI

Use Case

Ever had the following database structure and did not want the user to create the related resource (product_types) seperatly since it only consists of a unique name. But you don't want to put the product_type directly in the products table, since it would violate the third normal form.

Database setup example

This package solves this, by keeping the original belongsTo field but allowing the user to create a new resource by simply entering a not yet existing name. Additionally it includes the prepopulate-searchable package from alexbowers.

Installation

composer require sparclex/nova-creatable-belongs-to

Add field inside your fields Array. The parameters consist of the same ones as the laravel nova belongsTo field with an additional nameAttribute which determines the name of the display attribute in the related model (default: name).

public function fields(Request $request)
{
    return [
        ID::make()->sortable(),
        CreatableBelongsTo::make('ProductType', 'productType', 'App\Nova\ProductType', 'name')
            ->prepopulate()
    ];
}

TODO

  • Tests
  • Respect policies for creation

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 10
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固