定制 lhilton/text-auto-complete 二次开发

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

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

lhilton/text-auto-complete

最新稳定版本:v1.0.1

Composer 安装命令:

composer require lhilton/text-auto-complete

包简介

A Laravel Nova text field supporting autocomplete from an array of values.

README 文档

README

A Laravel Nova text field supporting autocomplete from an array of values. The field is a simple text field with the ability to provide autocompletion from an array of strings.

This does not force the selection of an item. The user will be free to type arbitrary text.

Demo

Text Auto Complete

Installation

From the command line:

composer require lhilton/text-auto-complete

Usage

Provile an array of strings that you want to be shown during usage.

use Lhilton\TextAutoComplete\TextAutoComplete;

public function fields(Request $request)
{
    return [
        TextAutoComplete::make('Regions')->items([
            'Alabama',
            'Alaska',
            'Arizona',
            'Arkansas',
            // ...
            'West Virginia',
            'Wisconsin',
            'Wyoming'
        ]),
    ];
}

You can feed from an Eloquent model like this:

use App\Models\User;
use Lhilton\TextAutoComplete\TextAutoComplete;

public function fields(Request $request)
{
    return [
        TextAutoComplete::make('Regions')->items(
            User::select('title')
                ->distinct()
                ->get()
                ->pluck('title')
                ->filter()
                ->values()
                ->toArray();
        ),
    ];
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固