mahmudkuet11/nova-multiselect-field 问题修复 & 功能扩展

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

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

mahmudkuet11/nova-multiselect-field

Composer 安装命令:

composer require mahmudkuet11/nova-multiselect-field

包简介

A multiple select field for Laravel Nova.

README 文档

README

This Laravel Nova package adds a multiselect to Nova's arsenal of fields.

Screenshots

Detail View

Form View

Index View

Installation

Install the package in a Laravel Nova project via Composer:

composer require mahmudkuet11/nova-multiselect-field

Usage

The field is used similarly to Nova's native Select field. The field type in the database should be text-based (ie string, text or varchar), selected values are stored as a JSON array.

use Mahmud\MultiselectField\Multiselect;

public function fields(Request $request)
{
    return [
      Multiselect
        ::make('Favourite football teams', 'football_teams')
        ->options([
          'liverpool' => 'Liverpool FC',
          'tottenham' => 'Tottenham Hotspur',
          'bvb' => 'Borussia Dortmund',
          'bayern' => 'FC Bayern Munich',
          'barcelona' => 'FC Barcelona',
          'juventus' => 'Juventus FC',
          'psg' => 'Paris Saint-Germain FC',
        ])

        // Optional:
        ->placeholder('Choose football teams')
        ->max(4)
        ->optionsLimit(5)
    ];
}

Options

Possible options you can pass to the field using the option name as a function, ie ->placeholder('Choose peanuts').

Option type default description
options Array [] Options in an array as key-value pairs (['id' => 'value']).
placeholder String Field name The placeholder string for the input.
max Number Infinite The maximum number of options a user can select.
optionsLimit Number 1000 The maximum number of options displayed at once. Other options are still accessible through searching.
resolveForPageResponseUsing Callable null Only for use in conjunction with Page Manager. Allows you to format the value before it is returned through the API.
nullable Boolean false If the field is nullable an empty select will result in null else an empty array ([]) is stored.

Credits

License

This project is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固