scouser03/nova4-multiselect
最新稳定版本:1.4.0
Composer 安装命令:
composer require scouser03/nova4-multiselect
包简介
A Laravel Nova field.
README 文档
README
Installation
First you must install this package in to a Laravel app that uses Nova via composer:
composer require scouser03/nova4-multiselect
Usage
namespace App\Nova; use Spatie\TagsField\Tags; use Scouser03\Nova4Multiselect\Nova4Multiselect; class BlogPost extends Resource { // ... public function fields(Request $request) { return [ // ... Nova4Multiselect::make('select name with model', 'tags') //tags is relation name ->table('post_tag') //Relation table ->inputId('uuid') //Sets the id of the input element. default - id ->label('tag') // What key to use when generating option labels when each option is an object, default - name ->indexUpdateable(true) //when attach new tag to index resource ->model(Tag::class), //get all data with model Nova4Multiselect::make('select name with query', 'tags') ->table('post_tag') ->label('tag') ->query(Tag::query()->take(3)->get()), //pass collection data // ... ]; } }
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 510
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-25