PHP code example of whchi / nova-tags-input

1. Go to this page and download the library: Download whchi/nova-tags-input 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/ */

    

whchi / nova-tags-input example snippets


use Whchi\NovaTagsInput\Tags;
...
  Tags::make('tags')->autocompleteItems(['tag1', 'tag2'])

return [
    'style_variables' => [
        // index, detail field
        '--nti-tag-bgcolor' => 'var(--primary)',
        '--nti-tag-mr' => '5px',
        '--nti-tag-color' => '#fff',
        // form field
        '--ti-valid-bgcolor' => 'var(--primary)',
        '--ti-deletion-mark-bgcolor' => 'var(--danger)',
        '--ti-selected-item-bgcolor' => 'var(--primary)',
    ],
    'props' => [
        'add-from-paste' => true,
        'add-on-blur' => true,
        'add-on-key' => [13],
        'add-only-from-autocomplete' => false,
        'allow-edit-tags' => false,
        'autocomplete-always-open' => false,
        'autocomplete-filter-duplicates' => true,
        'autocomplete-min-length' => 1,
        'avoid-adding-duplicates' => true,
        'delete-on-backspace' => true,
        'disabled' => false,
        'max-tags' => null,
        'maxlength' => null,
        'placeholder' => 'Add Tag',
        'save-on-key' => [13, ':', ';'],
        'separators' => [';'],
    ],
];

sh
php artisan vendor:publish --provider="Whchi\NovaTagsInput\FieldServiceProvider"