blendbyte/nova-items-field
Composer 安装命令:
composer require blendbyte/nova-items-field
包简介
Array items field for Laravel Nova with drag/drop sorting, validation & flexible display options. Fork of dillingham/nova-items-field, maintained for Nova 5.
README 文档
README
Laravel Nova array items field with sorting, validation & many display options.
Forked from dillingham/nova-items-field.
Installation
composer require blendbyte/nova-items-field
Quick Start
use NovaItemsField\Items; function fields() { return [ Items::make('Emails'), ]; }
Be sure to cast the property as an array on your Eloquent model:
public $casts = [ 'emails' => 'array', ];
Validation
Use Laravel's built-in array validation:
Items::make('Emails')->rules([ null => 'required|min:2', '*' => 'email|min:10', ]),
In this case, an error is produced if there aren't at least 2 items in the array and if each item is not a valid email or is shorter than 10 characters.
You can also use explicit attribute names — the behaviour is exactly the same:
Items::make('Emails', 'user_email')->rules([ 'user_email' => 'required|min:2', 'user_email.*' => 'email|min:10', ]),
Array Processing
Use the array to perform other actions by making an observer:
function saving($user) { foreach ($user->emails as $email) { // } }
Customizing the Vue Component
You can replace the default item Vue component — see this walkthrough for a brief guide.
Options
| Method | Description | Default |
|---|---|---|
->max(number) |
Limit number of items allowed | false |
->draggable() |
Turn on drag/drop sorting | false |
->fullWidth() |
Increase the width of the field area | false |
->maxHeight(pixel) |
Limit the height of the list | false |
->listFirst() |
Move "add new" to the bottom | false |
->inputType(text) |
Input type: text, date, etc. |
"text" |
->placeholder($value) |
Placeholder text for the new item input | "Add a new item" |
->deleteButtonValue($value) |
Label for the delete button | "x" |
->createButtonValue($value) |
Label for the create button | "Add" |
->hideCreateButton() |
Hide the "Add" button | false |
->indexAsList() |
Display items as a list on index instead of a count | false |
->detailsAsTotal() |
Display item count on detail view instead of a list | false |
Maintained by Blendbyte
Blendbyte builds cloud infrastructure, web apps, and developer tools.
We've been shipping software to production for 20+ years.
This package runs in our own stack, which is why we keep it maintained.
Issues and PRs get read. Good ones get merged.
blendbyte/nova-items-field 适用场景与选型建议
blendbyte/nova-items-field 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 576.9k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2022 年 04 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「nova」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 blendbyte/nova-items-field 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 blendbyte/nova-items-field 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 blendbyte/nova-items-field 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
A Laravel Nova package for publishable fields
A Laravel Nova package for translatable fields
A Laravel Nova Image field. you can paste or drag or chose an image
A Laravel Nova Mail testing tool.
统计信息
- 总下载量: 576.9k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-12
