sukohi/form-autocomplete

A PHP package mainly developed for Laravel to generate form input tags of Bootstrap that can automatically display errors, labels and alerts.
889 1
Install
composer require sukohi/form-autocomplete
Latest Version:2.0.0
PHP:>=5.4.0
Laravel:5
Older releases:4
License:MIT
Last Updated:Jul 7, 2016
Links: GitHub  ·  Packagist
Maintainer: Sukohi

FormAutocomplete

A PHP package mainly developed for Laravel to generate javascript tag for auto-complete through jQuery UI.
(This is for Laravel 5+. For Laravel 4.2)

Installation

Add this package name in composer.json

"require": {
  "sukohi/form-autocomplete": "2.*"
}

Execute composer command.

composer update

Register the service provider in app.php

'providers' => [
    ...Others...,  
    Sukohi\FormAutocomplete\FormAutocompleteServiceProvider::class,
]

Also alias

'aliases' => [
    ...Others...,  
    'FormAutocomplete'   => Sukohi\FormAutocomplete\Facades\FormAutocomplete::class
]

Requirement

Usage

(in View)

<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>

<!-- jQuery UI -->
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>

<!-- Input -->
<input id="title_1" type="text">
<input id="title_2" type="text">
<input id="title_3" type="text">

<script>

    $(document).ready(function(){

        // Using Array

        {!! FormAutocomplete::selector('#title_1')->source(['aaaaa', 'bbbbb', 'cccccc']) !!}

        // Using Closure

        {!! FormAutocomplete::selector('#title_2')->source(function(){

            return \Item::where('id', '>', 2)->lists('title');  // You need to return array values.

        }) !!}
        
        // Using Table and column

        {!! FormAutocomplete::selector('#title_3')->db('items', 'title') !!}

    });

</script>

License

This package is licensed under the MIT License.

Copyright 2015 Sukohi Kuhoh

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

598,760,099 34,966
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

399,241,428 4,660

Version History

Version Released PHP Laravel License
2.0.0 ~5.0 MIT
1.0.1 >=5.4.0 4.2.* MIT
1.0.0 >=5.4.0 4.2.* MIT