mxms/autocomplete

A custom autocomplete field for Laravel Nova 4.

dev-master 2024-07-03 05:35 UTC

This package is auto-updated.

Last update: 2024-11-03 06:19:49 UTC


README

An autocomplete / autosuggestion field for Laravel Nova 4.0

Installation

  1. Install via Composer:

    composer require mxms/autocomplete

Usage

  1. Populating autosuggestions:

    use Mxms\Autocomplete\Autocomplete;
    
    public function fields(NovaRequest $request)
    {
        $userNames = User::pluck('name')->toArray();
        return [
            Autocomplete::make('User', 'user')->items($userNames)
        ];
    }

License

The MIT License (MIT).