定制 marshmallow/prefiller-field 二次开发

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

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

marshmallow/prefiller-field

最新稳定版本:2.3.1

Composer 安装命令:

composer require marshmallow/prefiller-field

包简介

A Laravel Nova field to prefill fields based on another field. Super Awesome!

README 文档

README

A Laravel Nova field to prefill fields based on another field. Super Awesome!

Installation

composer require marshmallow/prefiller-field

Usage

public function fields(Request $request)
{
    return [
		BelongsTo::make('Product')->nullable()->searchable(),

		PrefillerText::make('Test', 'field_2')
                    ->sourceField('product')
                    ->sourceModel(\Marshmallow\Product\Models\Product::class)
                    ->prefillWith('name'), // This can be a field or a method on your target resource

        PrefillerCurrency::make('Test 3', 'field_3')
                    ->sourceField('product')
                    ->sourceModel(\Marshmallow\Product\Models\Product::class)
                    ->prefillWith('price')
                    ->currency('EUR')
                    ->default(0)
                    ->nullable(),
	]
}

Extra methods

I you want the prefiller to check for new values, even if the target field is already filled with content, you can call the method allowUpdatingFilledFields().

Supported

Currently we have only implemented the Text and Currency field because we needed it in a project for a customer. We will add more in the comming months. Feel free to send a pull request if you need another field for your project.

Security

If you discover any security related issues, please email stef@marshmallow.dev instead of using the issue tracker.

License

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

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-24