mardi 12 janvier 2016

Laravel 5 autocomplete route Input class

I have autocomplete script in laravel 5, but I have problem with getting value from search field.

My route code:

use Illuminate\Support\Facades\Input;

Route::get('access_users/getdata',function(){

    **$query = Input::get('last_name');**

    $data = User::where('last_name','like','%'.$query.'%')
    ->take(10)
    ->get();

return $data;

});

Problem is, $query is empty everytime.

HTML code:

 {!! Form::text('last_name', null, ['class' => 'form-control', 'placeholder' => trans('strings.full_name')]) !!}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire