Laravel Autocomplete Search Twitter Typeahead Example

Laravel Autocomplete Search Twitter Typeahead Example

In this Post We Will Explain About is Laravel Autocomplete Search Twitter Typeahead Example With Example and Demo.Welcome on – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Implementing Smart Search with Laravel and Typeahead.js Example

In this post we will show you Best way to implement Twitter Typeahead integration using Laravel, hear for Laravel Autocomplete Search Twitter Typeahead integration with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Twitter Typeahead integration in Laravel

The Laravel Autocomplete Search twitter typeahead is the Best Easy Way fully supported jQuery ajax call live Autocomplete search download plugin available full soure completely free to Download below link. Another way to alternative to this simple plugin is Jquery UI Autocomplete. In this Post, We will Display you the Best way to Example integrate for Main latest version typeahead.js version 0.9.3 in your Laravel web app project. The Autocomplete search box will Fetch data remotely using ajax.

Also Read :   Highcharts Chart using Laravel with Database

The simple Javascript Source Code is given See below script

<!-- Laravel Typeahead -->
{!! Html::script('js/typeahead.min.js') !!}
        name: 'typeahead',
        remote:"{{ url('/search/%QUERY') }}",
        limit : 5,//here 10, 15 etc..

This scripts for material design lite way search auto-sugg box (You can Example and demo it on the main navigation simpe bar of this out web site) is given below soure code

<div style="padding-bottom:0px;" class="live24u mdl-textfield mdl-js-textfield mdl-textfield--expandable">
	<label class="live24u mdl-button mdl-js-button mdl-button--icon" for="Data-auto-search-expandable">
	  <i class="live24u material-icons">search</i>
	<div class="live24u mdl-textfield__expandable-holder">
		<input class="live24u mdl-textfield__input typeahead" type="text" name="search" id="search-expandable" style="width: 300px;">
	  <label class="live24u mdl-textfield__label" for="Data-auto-search-expandable"></label>

And then it is time to laravel main web.php setup routes in laravel

Also Read :   Laravel File(Image) upload with Validation Example

       ->where('key','^[\w\d\-\_\. ]+$');

Now the retriveSearch function code in LiveController

public function retriveSearch($datakey)
    $Books = Post::where('title', 'like', '%' . $datakey . '%')->limit(5)->get();
    foreach($Books as $book)
        $livearray[] = $book->title;
    return json_encode($livearray);      

Final Last step some CSS to improve the Autocomplete Search Box looks

.tt-hint {
  color: #7c5dff; }

.tt-dropdown-menu {
  background-color: #FFF;
  border: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 6px 11px rgba(0, 0, 0, 0.3);
  margin-top: 13px;
  padding: 9px 0;
  width: 320px; }

.live-auto-sugg {
  padding: 3px 20px; } {
  background-color: #7c5dff;
  color: #FFF; }

.live-auto-sugg p {
  margin: 0; }

Imp Note : We use an typeahead old version of Autocomplete typeahead So it is much stable and main easy to integrate than current typeahead version which is latest 11.1. If you are simple using latest version both your code and custom CSS will not work as We main design CSS for version 0.9.3. You can file download the Autocomplete Search Typeahead version 0.9.3 from download GitHub from the following Path of your link Twitter Typeahead integration using Laravel Libs

Also Read :   simple angularjs hello world example

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example


I hope you have Got What is Laravel Bootstrap Typeahead Autocomplete Search from Database And how it works.I would Like to have FeedBack From My Blog( readers.Your Valuable FeedBack,Any Question,or any Comments about This Article( Are Most Always Welcome.