I have just started with Laravel and I am trying to make a search function with proper pagination. The function works for page one but on pag
$searchdata = \Request::get( 'inputTextFieldname' ); \make as global
$searchresult = Modelname::where ( 'blogpost_title', 'LIKE', '%' .$searchdata . '%' )->paginate(2);
return view( 'search', compact('searchresult') );
and in your view page
{{$searchresult->appends(Request::only('inputTextFieldname'))->links()}}
make your route to get method
Route::get('/search', ['as' => 'search', 'uses' => 'searchController@index']);
this will be done, thanks,