Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

bootstrap autocomplete example laravel

<?php
namespace AppHttpControllers;
use IlluminateHttpRequest;
use AppModelsUser;
class TypeaheadController extends Controller
{
    public function index()
    {
        return view('welcome');
    }
 
    public function autocompleteSearch(Request $request)
    {
          $query = $request->get('query');
          $filterResult = User::where('name', 'LIKE', '%'. $query. '%')->get();
          return response()->json($filterResult);
    } 
}
Source by www.positronx.io #
 
PREVIOUS NEXT
Tagged: #bootstrap #autocomplete #laravel
ADD COMMENT
Topic
Name
2+1 =