Questions tagged [laravel-pagination]

Using pagination in Laravel Framework

197 questions
0
votes
1 answer

Laravel pagination in Eloquent Query Builder

I need help to paginate a table that has a relationship with another using Laravel pagination. I get an error that says... too fewer argument to function Controller public function users() { $users = User::join('customers', 'users.id', '=',…
0
votes
1 answer

Why is Laravel paginate() not working as expected but simplePaginate() does?

I have a model named Conversation. I want to show all the rows in the view by paginating them. I know to use the paginate() method or simplePaginate() method to paginate the results. In my case both paginate() and simplePaginate() paginates the…
sanketd617
  • 809
  • 5
  • 16
0
votes
1 answer

Laravel pagination change from ?page=1 to /page/1

I want to change default Laravel pagination behaviour. I want to change the query string to a route parameter: https://www.example.com/blog?page=2 to this: https://www.example.com/blog/page/2 I found this package but it is abandoned…
0
votes
1 answer

why laravel pagination just work with reture and not custom response Handler

if you see this code: use ResponseHandler; public function search(SoundFilter $soundFilter) { $sounds = Sound::query(); $sounds->filter($soundFilter); // dd($sounds->toSql()); $sounds = $sounds->paginate(1); …
hossein
  • 39
  • 3
0
votes
1 answer

How to get all table names from db and paginate them

Trying to paginate DB::select('SHOW TABLES')->paginate(1); but got error Call to a member function paginate() on array. How can I get all the tables and paginate them?
mohsin
  • 123
  • 9
0
votes
1 answer

pagination not working with new php function via ajax

I am fetching records via ajax with search parameters and want to have pagination also. It works fine if I use it with the same function which loads view, for example function viewOrder(Request $request){ $data = products::where('categoryId',…
Mohsin
  • 179
  • 4
  • 13
0
votes
1 answer

Pagination Not Working With filter. Click page 2(with filter) will return to Page 2 with no filter

I have problem with pagination. while using it with filter, only the first page is working. Controller public function create(Request $request) { $products = Product::where(function($query) { // filter category $category =…
0
votes
1 answer

Laravel pagination link not working in blade file

My pagination works right at localhost but not at server.The page counts are displayed correctly, but the first page information is only displayed. controller : $customers = Customer::orderBy('id','desc')->paginate(10); return…
F.Joodaki
  • 141
  • 3
  • 16
0
votes
1 answer

Add attributes to Laravel pagination links

Please look into my code, this is my web.php Route::get('test', function (Request $request) { $data = MyTableResource::collection(MyTable::paginate(10)); $headers = ['col1', 'col2', 'col3']; return view('test.index', compact('data',…
Sandeep Sudhakaran
  • 1,072
  • 2
  • 9
  • 22
0
votes
0 answers

Laravel Search Query Pagination - page 2 returning error "localhost redirected too many times"

I have a search bar that allows users to search for other profiles, I'm using the 'simplePaginate' method to show one result per page (this is for testing purposes and will be a higher amount when working). The first page loads fine with the issue…
Bodman
  • 91
  • 6
0
votes
1 answer

Paginating tag list

I'm having trouble paginating my tag page which lists all the products that are associated to a tag (many to many). The tag page is found on slug. I have the lists of products associated with the tag ordered on the highest average rating from the…
detinu20
  • 299
  • 3
  • 20
0
votes
2 answers

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…
0
votes
2 answers

How to Implement Pagination with Laravel Collections?

As far as I know that Laravel pagination doesn't work with Laravel collections (Eloquent). For example: $articles = Article::with('category')->where('status', 'submitted')->get(); I'm trying to make pagination with above code snipped but …
0
votes
0 answers

setPath() is not holding sorted value in Laravel

I am using LengthAwarePaginator for pagination. But it is not holding sorted value. If sort value is 1 then it should sort name by ascending order. It give me result on first page. But when I click on second one. It is not holding result. My route…
0
votes
3 answers

Laravel Searching with Pagination?

I've been trying so hard to get this but I couldn't. Searching is all working fine also pagination is appearing, but whenever I click on any page number is opens a blank page since there is no route to "GET" that request, can anyone please lead to…
Vipertecpro
  • 3,056
  • 2
  • 24
  • 43