lupennat/items 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

lupennat/items

最新稳定版本:v1.1.1

Composer 安装命令:

composer require lupennat/items

包简介

Laravel Nova - Items Field

README 文档

README

  1. Requirements
  2. Installation
  3. Usage
  4. Validation
  5. Additional options
  6. Credits

Requirements

  • php: ^7.4 | ^8
  • laravel/nova: ^4

Installation

composer require lupennat/items

Usage

Laravel Nova array items field with sorting, validation & many display options

use Lupennat\Items\Items;
function fields() {
    return [
        Items::make('Emails'),
    ]
}

and 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([
    'emails.*' => 'email|min:10',
]),

Manually setting the attribute may be needed in some cases.

Items::make('Long Text', 'attribute')->rules([
    'attribute.*' => 'email|min:10',
]),

Additional options

function description default
->max(number) limit number of items allowed false
->draggable() turn on drag/drop sorting false
->onlyDraggable() turn on drag/drop sorting and off add,delete,editing false
->inputType(text) text, date, etc (support "select") "text"
->placeholder($value) the new item input text "Add a new item"
->actionText($value) value for create button "Add"
->disableAddingRows() hide the "add" button false
->disableDeletingRows() hide the "delete" button false
->disableEditingRows() input on readonly mode false
->displayAsList() display list on index as list instead of comma separated values "group"

Credits

Items field is based on Nova Items Field.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-22