Browse AI Field GuideForum Podcast
All ThreadsLeaderboard
  1. Discussions

    1. Popular This Week
    2. Popular All Time
    3. Solved
    4. Unsolved
    5. No Replies Yet

HDS2019's avatar

Laravel pagination not working in method chain

Works fine: User::paginate(10) ->appends(request()->all()); Output: { "data": [ { "id": 1, "email": "[email protected]", }, { "id": 2, "email": "[email protected]", }, ], "current_page": 1, "first_page_url&q

HDS2019's avatar
HDS2019's avatar MichalOrav...5yrs agoEloquent
2
1
Last reply by MichalOravec 5yrs ago
joneyspark's avatar

How to Make Vue 3 and Laravel Pagination ?

Hi, Can you suggest how I could make Vue 3 and Larvel Pagination? some of the package I used for Vue 2 but in Vue 3 it's not working properly

joneyspark's avatar
joneyspark's avatar orph4ns2yrs agoVue
8
1
Last reply by orph4ns 2yrs ago
Randy_Johnson's avatar

Pagination Links Extending Past Div

My pagination links are extending too far. How do I keep it inline with the div. https://ibb.co/HgKYRwm

Randy_Johnson's avatar
Randy_Johnson's avatar jlrdw5yrs agoGeneral
2
1
Last reply by jlrdw 5yrs ago
Hlaing_Min_Than's avatar

I found Vue-laravel pagination Bugs When User Add new Reply

Anyone Notice That Vue-laravel pagination episodes from Laracasts( Build A forum with Laravel Tdd Sereis) have some bugs. Like Pagination Links is not dynamically work on when adding or deleting reply how u guys fix it ? Any Idea? Pls discuss with me

Hlaing_Min_Than's avatar
Hlaing_Min_Than's avatar Hlaing_Min...5yrs agoVue
0
1
batotanete's avatar

Display PAGINATION groupBy in BLADE View

How to display PAGINATION in BLADE View, please? I have tried using: {{ $monitoring_kgb->links() }} But an error occurred: Method Illuminate\Database\Eloquent\Collection::links does not exist. Controller: $monitoring_kgb = MonitoringKGB::with('pegawai') ->orderBy('tgl_mulai_kgb', 'ASC') ->paginate(10) ->groupBy(function ($val) {

batotanete's avatar
batotanete's avatar jlrdw5yrs agoLaravel
7
1
Last reply by jlrdw 5yrs ago
maxdiable's avatar

yajra/laravel-oci8 pagination

hi, have any example for pagination in "yajra/laravel-oci8" ? br Max

maxdiable's avatar
maxdiable's avatar maxdiable5yrs agoLaravel
10
1
Last reply by maxdiable 5yrs ago
Naysoewin's avatar

Load more instead of pagination

Hello everyone, Currently, i am working on React and Laravel project , I just would like to achieve 'load more' instead of pagination , Actually i have pretty simple index method that implementing with spatie query builder. public function index() { $products = QueryBuilder::for(Product::class) ->allowedFilters([ 'subject',

Naysoewin's avatar
Naysoewin's avatar bugsysha5yrs agoLaravel
1
1
Last reply by bugsysha 5yrs ago
adityar15's avatar

Livewire dom diffing issue for pagination and bootstrap modal

So the problem is kind of a complex one. I have a list of items that I am fetching from the database with custom pagination. The reason for custom pagination is I need to call API through a livewire component. In a blade file (normal view file) I have two livewire components @livewire('items') @livewire('modalcomponent') <script> window.addEventListener('showmodal',

adityar15's avatar
adityar15's avatar adityar155yrs agoLaravel
2
1
Last reply by adityar15 5yrs ago
mstdmstd's avatar

How to make listing with pagination with pretty url

Hello, In laravel 8 I try to make listing with pagination with url like http://site.com/admin/categories/page/3 and looking at branch https://stackoverflow.com/questions/20974404/laravel-pagination-pretty-url I tried to remade it for laravel 8 , replacing method getCurrentPage with ->path() method : $links = $categories->links(); $patterns = array();

mstdmstd's avatar
mstdmstd's avatar Garet4yrs agoLaravel
3
1
Last reply by Garet 4yrs ago
finlamit's avatar

Vue laravel pagination and page refresh

Hi I have a page which is loading 10 articles. I am going to render a VUE component on the page which which grabs the articles from an api call with pagination, and then renders the articles and pagination on the page. I wanted to do it this way as I feel it offers a better user experience, rather than travelling to a new page. Problem I am finding is that when users click on a

finlamit's avatar
finlamit's avatar finlamit5yrs agoLaravel
2
1
Last reply by finlamit 5yrs ago
yng's avatar

pagination with (with function)

I used "with" function and I want pagination. but When I used paginate() after "with" func It didn't work well. I just want Message data . $messages = Room::with('recipients.message')->find($request->room_id); return response()->json(['messages' => $messages]); Room Model public function recipients() { return $this->hasMany(Reci

yng's avatar
yng's avatar yng5yrs agoLaravel
4
1
Last reply by yng 5yrs ago
ColWayne's avatar

Laravel 8 Pagination using withQueryString() not working as expected

I have this in a model //Doing a post request and passing a name $searchName = $request->input('name'); //To simplify the issue I am just pulling all users. $user = User::paginate(5)->withQueryString(); return view('dashboard', ['users' => $user]); In my view i have this for the pagination links. I assume per the docs the withQueryString would add the name I sent in t

ColWayne's avatar
ColWayne's avatar ColWayne5yrs agoLaravel
8
9
Last reply by ColWayne 5yrs ago
Prabodhana's avatar

Laravel pagination not working

I use laravel pagination to paginate data. its work but if I request it page to it response empty data array. This is mt function $cashbook = tblMainCashBook::whereBetween('date',[$request->input('from'),$request->input('to')])->paginate(50); $cashbook2 = tblMainCashBook::whereBetween('date',[$request->input('from'),$request->input('to')])->get();

Prabodhana's avatar
Prabodhana's avatar jlrdw5yrs agoLaravel
3
1
Last reply by jlrdw 5yrs ago
cdchap's avatar

Third party API and pagination

I have a component that makes a call to a third party API end point. Then I turn the response into a collection to use in the view. It works, but it doesn't feel right. I have not worked out how I would handle pagination either. I don't want to build all that out if I am going down the wrong path. Any advice would be appreciated. Cheers! TestComponent class TestComponent exten

cdchap's avatar
cdchap's avatar martinbean5yrs agoLivewire
5
1
Last reply by martinbean 5yrs ago
lilo's avatar

Laravel Pagination Problem

Hi, I want to paginate my blade. My route: Route::get('/publicatons', function () { $publications = Publications::orderBy('date','DESC')->paginate(5); return view('our_publications',['publications'=>$publications]);}); My blade: <section> <div class="container"> <div class="row"> <div class="masonry ma

lilo's avatar
lilo's avatar Nimrod5yrs agoEloquent
4
1
Last reply by Nimrod 5yrs ago
webfuelcode's avatar

Search results pagination works not

What is wrong here that the pagination does not work. <form action="{{ route('search') }}" method="GET" role="search"> <div class="search"> <input type="text" class="form-control searchTerm" name="q" placeholder="What are you look

webfuelcode's avatar
webfuelcode's avatar ankush9815yrs agoLaravel
6
1
Last reply by ankush981 5yrs ago
redlik's avatar

Pagination shows next prev instead of numbers

Hi folks, I have a small issue with my pagination view, not sure when this happened, did I switched something but instead of page numbers on my paginated pages I have next/prev buttons only. All my views are done via Livewire, if that matters, and I have just regular ...->links() functions on my template. Never used the simplePaginate functionality on this site so I'm bit co

redlik's avatar
redlik's avatar redlik5yrs agoLivewire
2
1
Last reply by redlik 5yrs ago
binggle's avatar

Livewire / Pagination / Child Component work wrong.

hi.. I found Livewire Pagination reacts wrong with children's 'emit' event.. I have Two Livewire components. 'ParentComponent' embrace 'ChildComponent' . In ChildComponent I do something and trigger 'updated' event ' So ParentComponent grab the 'updated' event. After grabbing event, refreshing list datatable and clicking page 2, the pagination url goes wrong. The url path goes

binggle's avatar
binggle's avatar binggle5yrs agoLivewire
8
1
Last reply by binggle 5yrs ago
tomasosho's avatar

How to create A-Z pagination

In laravel How can I create A-Z pagination for example I've a table users I want to create sorting pagination from the first letter like In character A all the users starting with A must be the same with A-Z.

tomasosho's avatar
tomasosho's avatar tomasosho5yrs agoLaravel
4
1
Last reply by tomasosho 5yrs ago
Ifrit's avatar

Pagination not working

I'm trying to create a pagination, the problem is, is that when I try to create the pagination I get this error Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException The GET method is not supported for this route. Supported methods: POST. http://laravel-site.test/livewire/message/category.show?page=2 I'm using laravel and livewire. This is my code <?php

Ifrit's avatar
Ifrit's avatar Snapey5yrs agoLaravel
1
1
Last reply by Snapey 5yrs ago
usamafiaz's avatar

pagination with search filter

how to create filter pagination when input in search field tag

usamafiaz's avatar
usamafiaz's avatar usamafiaz5yrs agoLaravel
4
1
Last reply by usamafiaz 5yrs ago
binggle's avatar

Pagination in Many-to-Many Relationship.

getting pagination of many to many relationship ?? hi I have two models, Cat ( category) / Video It is many to many relationship.. One Cat has many to many Videos. I want to use pagination when getting videos of category. Models.. class Cat extends Model { public function videos() { return $this->belongsToMany( Video::class, 'cat_video' ); } } class Vide

binggle's avatar
binggle's avatar binggle5yrs agoEloquent
2
1
Last reply by binggle 5yrs ago
Linda Maya's avatar

How to correct scattered pagination links and objects view in browser while using pagination() function in Laravel 8

I am working on Laravel 8 framework, PHP 8 and MariaDB 10.4.17. I am using paginate() feature in controller class and {{$variable->links()}} in .blade.php view file. When testing the outcome on the browser, I am getting the paginator links and objects scattered. Here is how I use paginate() in controller class : class Homepage extends Controller { public function index()

Linda Maya's avatar
Linda Maya's avatar Linda Maya5yrs agoLaravel
4
1
Last reply by Linda Maya 5yrs ago
Omda's avatar

How could I remove duplication from pagination

this my helper method for a pagination if(!function_exists('paginate')){ /** * @param $items * @param int $perPage * @param null $page * @param array $options * @return array */ function paginate($items, $perPage = 15, $page = null, $options = []): array { $page = $page ?: (Paginator::resolveCurrentPage() ?: 1); $items

Omda's avatar
Omda's avatar Tray25yrs agoLaravel
5
1
Last reply by Tray2 5yrs ago
zanix's avatar

Livewire table sequence numbers with pagination

What is the best way to keep track of sequence numbers in the Livewire paginated table? The first column in my table contains sequence numbers from 1 to "total number of rows" everything was fine with Blade's $loop->iteration but when I introduced pagination on each page that sequence is starting from 1 every time and I don't want that I want to keep track of each

zanix's avatar
zanix's avatar zanix5yrs agoLivewire
2
1
Last reply by zanix 5yrs ago
caglayantolga35's avatar

Laravel Pagination Multilang

@if ( Config::get('app.locale') == 'en' && $blogs->lang == 'en') <div class="isotope_item vrbloglist"> <div class="item-image"> <a href="{{ url('/en/blog/'.$blogs->slug) }}"><img src="{{ asset($blogs->blog_resim) }}" alt="blog" class="img-fluid

caglayantolga35's avatar
caglayantolga35's avatar tisuchi5yrs agoLaravel
1
1
Last reply by tisuchi 5yrs ago
saadaan's avatar

Export table data with PAGINATION

Hi, I have a fairly big table with data, and using pagination to handle the segregation. Now I need to give the option of DOWNLOAD AS EXCEL or CSV in the table. Can someone point me to any resource which could help in this with pagination intact? Thanks, Saad

saadaan's avatar
saadaan's avatar hungwww5yrs agoLaravel
2
1
Last reply by hungwww 5yrs ago
Magalliu's avatar

Redirect to current page or to 1st page when pagination is empty

So I want to redirect back to current page or to page 1 in case that the pagination does not exist so I can avoid that laravel can return empty string. I'm a litt blocked here cause I don't have any solution in my mind how can I manage this in blade or elsewhere. Any suggestion how to achieve this? Thanks!

Magalliu's avatar
Magalliu's avatar Magalliu3yrs agoLaravel
12
3
Last reply by Magalliu 3yrs ago
Lordbedwetter's avatar

Links not Working with Livewire Pagination

HI there, I am currently working on a "simple" pagination feature for blog posts. My problem: the correct amount of posts and pagination links appear (and according to how many records are in the database), but do not navigate/change the data on the page when clicked. Here's what I've done: Made sure there is only one root div on the livewire component. Made sure the

Lordbedwetter's avatar
Lordbedwetter's avatar Lordbedwet...5yrs agoLivewire
1
1
Last reply by Lordbedwetter 5yrs ago
Rod2rick's avatar

Pagination doesn't work

Hello, i trying to paginate my bootstrap-vue Datatable, but some how the pagintion doesn't work. After looking well it seems that my array items [] is the problem and the this why the pagination stay to page 1. Her is the full code : <b-pagination v-model="currentPage" :total-rows="totalRows"

Rod2rick's avatar
Rod2rick's avatar MarianoMor...5yrs agoVue
9
1
Last reply by MarianoMoreyra 5yrs ago
UniqueHope's avatar

Multiple small tables on a single page, each with some form of pagination?

After a lot of searching and trying to figure out how to best do this, I've found that pagination in laravel gets really finicky with more than one table. Also, I was told that it would be probably good to be able to use server fetched partials as shown in here: https://laracasts.com/series/javascript-techniques-for-server-side-developers/episodes/1 and also to maybe try to kee

UniqueHope's avatar
UniqueHope's avatar MarianoMor...5yrs agoLaravel
1
1
Last reply by MarianoMoreyra 5yrs ago
saadaan's avatar

Using pagination with search

Hi, I have a big dataset, and want to use pagination with search feature. Can someone please lead to an example of it? Many thanks, Saad

saadaan's avatar
saadaan's avatar MichalOrav...5yrs agoLaravel
3
1
Last reply by MichalOravec 5yrs ago
sauravs012's avatar

Laravel pagination URL without query string

I've used this article for pagination: https://usingphp.com/post/make-custom-pagination-url-in-laravel-without-query-strings There demo is: https://usingphp.com/posts/wordpress But, there are only next and previous pagination links, but i want all numbers of pagination. Can someone please help me with that

sauravs012's avatar
sauravs012's avatar warpig5yrs agoGeneral
7
1
Last reply by warpig 5yrs ago
jinsonjose's avatar

How to apply pagination in different query results ?

How to apply pagination in different query results ? ->join('sectors', 'sectors.id','incidents.sector_id') ->join('incident_notes', 'incident_notes.incident_id','incidents.id') ->leftJoin('bdms', 'bdms.id','sectors.bdm_id')

jinsonjose's avatar
jinsonjose's avatar MichalOrav...5yrs agoLaravel
2
1
Last reply by MichalOravec 5yrs ago
lukegalea16's avatar

Livewire vs Pagination

I am looking to implement a section with messages from my DB with a 'Load More' functionality - thus I am not sure whether I should take the pagination route or use Livewire. Any comments or suggestions are appreciated.

lukegalea16's avatar
lukegalea16's avatar lukegalea1...5yrs agoLaravel
3
1
Last reply by lukegalea16 5yrs ago
alexvolley's avatar

Livewire pagination stops working after a couple requests

Has anyone experienced this? I'm not really sure what to show here, so here are the pagination links {{ $stores->appends(request()->query())->links() }} and then I am using this in the render method $stores = Programme::orderBy('store_id', 'ASC') ->paginate(8); return view('livewire.dashboard.main-table', compact('stores')); And every single t

alexvolley's avatar
alexvolley's avatar alexvolley5yrs agoLivewire
1
1
Last reply by alexvolley 5yrs ago
mathewp's avatar

laravel livewire pagination with a collection

Hi , how can i use livewire pagination with the following user collection my component: $this->users = User::with('roles','permissions')->get(); return view('livewire.permission.user_permissions',[$this->permissions,$this->roles, $this->users])

mathewp's avatar
mathewp's avatar rodrigo.pe...1yr agoLaravel
7
2
Last reply by rodrigo.pedra 1yr ago
lukegalea16's avatar

Pagination and Search Table

Can someone please provide me with a suitable example which loads several records into an HTML table and has the option to search as well. Pagination should be used due to the large amount of records. Thanks Luke

lukegalea16's avatar
lukegalea16's avatar jlrdw5yrs agoLaravel
2
1
Last reply by jlrdw 5yrs ago
sanjayacloud's avatar

Clicksend Pagination does not work on Laravel

Hi Guys, I am working on getting messages history from ClickSend API, I am trying to message from it API as there documentation. But pagination doesn't work. It's only getting the first 15 recorded. Not getting page number as parameter what I send it. Anyone know how does it do? Can I know where I am wrong? This is my controller Method. public function index(Request $reques

sanjayacloud's avatar
sanjayacloud's avatar sanjayaclo...5yrs agoLaravel
4
1
Last reply by sanjayacloud 5yrs ago
SunnyBoy's avatar

Laravel 8 using Bootstrap pagination?

Not sure what am i missing here but have tried both laravel ui and fortify as well with bootstrap 4 scaffolding everything seems to work (as per what i need) but unfortunately Pagination did not. At least based on what's in Laravel 8 doc. use Illuminate\Pagination\Paginator; public function boot() { Paginator::useBootstrap(); } I see the tailwind classes on view source. A

SunnyBoy's avatar
SunnyBoy's avatar SunnyBoy5yrs agoLaravel
1
1
Last reply by SunnyBoy 5yrs ago
dam-man's avatar

Pagination object from laravel API

I am getting data from an API, and now need to implement the bootstrap pagination, for some reasons I can't get it done. { "status": 200, "data": { "current_page": 1, "data": [ { "id": 1602069265173675200, "name": "Project 1", "description": "eerste projectje", &qu

dam-man's avatar
dam-man's avatar automica5yrs agoLaravel
5
1
Last reply by automica 5yrs ago
AwadGorg's avatar

Vuejs Laravel Pagination

Hello, am building this app to learn how to work with NUXTJS and am kind of stuck on how can i make pagination using nuxtjs(vuejs) with laravel i already made an api with laravel that return data using paginate, here is the code am using right now and it's not working, <template> <div v-if="browsergames_list.last_page > 1"> <ul class="pagi

AwadGorg's avatar
AwadGorg's avatar AwadGorg5yrs agoVue
0
1
felloz's avatar

Argon Dashboard: Pagination Looks Bad

Hi, I'm giving a try to Argon Dashboard, the Laravel Version https://www.creative-tim.com/product/argon-dashboard-laravel But for some reason the Laravel pagination isn't working Im trying 2 ways to do it but neither of those works: <nav aria-label="..."> <ul class="pagination pagination-lg"> {!! $emails->links() !!} </ul> <

felloz's avatar
felloz's avatar rodrigo.pe...5yrs agoLaravel
3
1
Last reply by rodrigo.pedra 5yrs ago
jamols09's avatar

Inserting Pagination

I have this user with roles for some reason I need to manipulate the result. I used map collection so I can have the desired format of data. The issue is that when I did use the map. It removed the values of pagination such as first_page_url: "http://127.0.0.1:8000/api/admin/users?page=1", , to: 3, or total: 11 etc. Is there a possible way to insert back the values fo

jamols09's avatar
jamols09's avatar Sinnbeck5yrs agoLaravel
10
1
Last reply by Sinnbeck 5yrs ago
eggplantSword's avatar

Search and Pagination troubleshooting

I have this code, I want to be able to search through all products regardless on what page the pagination is on, however now it's doing a couple weird things. Only searching through items on current page, when not on first page When clearing the search the v-for doesn't reset correctly, it resets to the page is was before but the pagination number reads as 1 when it's not. &l

eggplantSword's avatar
eggplantSword's avatar rodrigo.pe...5yrs agoVue
8
1
Last reply by rodrigo.pedra 5yrs ago
BigSpender's avatar

Pagination: redirect to index

Hello everyone. I added pagination in blade something like {!! $products->links() !!} And as result I have link in results: http://site.devv/{some_category}?page=1 I need if page=1, then redirect to http://site.devv/{some_category} Do we have some elegant methods to do that? Thank you.

BigSpender's avatar
BigSpender's avatar Nakov5yrs agoRequests
1
1
Last reply by Nakov 5yrs ago
aureliee123's avatar

Pagination ajax filter

Hello , i'm working on an ecommerce website where i need to filter products currently i'm sending an ajax request to the controller get the data and then append it to the view however it doesn't work when i use laravel pagination any solutions ?

aureliee123's avatar
aureliee123's avatar drewdan5yrs agoLaravel
1
1
Last reply by drewdan 5yrs ago
garrynacov's avatar

How to limit in pagination in laravel ?

how to query for pagination limit in laravel ?

garrynacov's avatar
garrynacov's avatar SarbjitGre...5yrs agoLaravel
4
1
Last reply by SarbjitGrewal 5yrs ago
Meaulnes's avatar

Why this strange behaviour with livewire and pagination and how to fix it?

I started with Laravel 8 and livewire a few days ago. I still have a lot to discover but I am on my way. Lastly, I encountered a behaviour I have trouble understanding. My goal I want to create a page to CRUD posts. What I want is to have a post list that is paginated displayed at the bottom of the page, a button to create a new post and the possibility to click a button on eac

Meaulnes's avatar
Meaulnes's avatar Meaulnes5yrs agoLaravel
1
1
Last reply by Meaulnes 5yrs ago
nexcode's avatar

How to properly view laravel 8 pagination with tailwind

Hi am learning laravel and was trying to do pagination. But the next and previous buttons are not styled properly (They are too big). A quick internet search revealed that it was because Laravel 8 uses tailwindcss by default for pagination and that switching it to bootstrap by adding this code in AppServiceProvider and linking my file to bootstrap.css will fix it. use Illumin

nexcode's avatar
nexcode's avatar nexcode5yrs agoLaravel
9
1
Last reply by nexcode 5yrs ago

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.