PHP code example of gkermer / nova-text-auto-complete

1. Go to this page and download the library: Download gkermer/nova-text-auto-complete library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gkermer / nova-text-auto-complete example snippets


use Gkermer\TextAutoComplete\TextAutoComplete;

TextAutoComplete::make('Favourite Fruit')->items([
    'Apple',
    'Apricots',
    'Avocado',
    'Banana',
    'Blueberries',
]),

TextAutoComplete::make('Favourite Fruit')->items(
    Fruit::pluck('name')
),

TextAutoComplete::make('Favourite Fruit')->items(function($search) {
    return Fruit::where('name', 'like', '%' . $search . '%')
        ->get()
        ->pluck('name');
}),