jeudi 31 janvier 2019

Remove Query Parameter from Laravel Scout Pagination Links()?

I'm using Laravel Scout to search for objects in my database, and need to have the results paginated, but Scout is automatically including a 'query' query term in the url in addition to the page number instead of just the page number.

I'm using the Scout built in pagination like so: $page_results = Page::search($validatedData['search_terms'])->paginate(10, 'page_results');

The problem is that instead of just getting the page number as a query, I'm also getting another 'query' stuck in there as well: http://192.168.10.10/wiki/search?query=a&page_results=2

As my route is like this: Route::post('/search', 'SearchController@search'); Its not expecting that query and is sending it to the fallback.

Is there a way to remove the 'query' query from the Scout links()? What I would like ideally is the following as I've got pagination working on other pages just fine by using the Eloquent pagination which doesn't include that extra query term: http://192.168.10.10/wiki/search?page_results=2

Any help would be much appreciated!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire