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

Duckz_1209's avatar

Pagination after update on VUE

is it possible that the pagination stays at the same page after updating data? my paginate goes back at page 1 after i update data on other page

Duckz_1209's avatar
Duckz_1209's avatar Duckz_12096yrs agoVue
0
1
migdalius's avatar

Pagination and status post/page problem

In page and post i have column status "Active" and "Inactive", i display list of blogs list etc. @foreach($pages as $page) @if($page->status == 'ACTIVE') <article class="card card-product"> <div class="card-body"> <div class="row"> <aside class="col-sm-3"> <div class="i

migdalius's avatar
migdalius's avatar Szach6yrs agoLaravel
1
1
Last reply by Szach 6yrs ago
mikelovely's avatar

Which pagination approach is more performant?

Which is more performant (in general)?: Get all records from db table (no sorting, no limits) Put in to a Collection and sort by user input Put Collection in to a Paginator and return paginated records based on user input Get all records from db table with user input using order and limit for pagination Take db response and return I appreciate this may depend on how b

mikelovely's avatar
mikelovely's avatar mikelovely6yrs agoGeneral
6
1
Last reply by mikelovely 6yrs ago
pentium's avatar

Pagination links() method doesn't exist

i have seen so many related topics to this problem but i could not find the solution. i am using pagination with eloquent but on my view i can not have access to the method links() public function myadd( Request $request ){ $ads = ads::where("userId",Auth::user()->id)->paginate(3); return view('clients.myadd')->with("ads",$ads); } th

pentium's avatar
pentium's avatar coreybothe...6yrs agoLaravel
5
1
Last reply by coreybother87 6yrs ago
Ksaif123's avatar

Laravel 5.7 Pagination previous & next links not functional with AJAX

I have encountered a problem with Laravel 5.7 & AJAX Pagination. My pagination links are working fine except the previous Url which is not going to backward links despite not being on first page, and the next page Url, which is not going to forward links and always stays at page 2. I've tried everything online. I've come to two conclusions after research: currentPage() met

Ksaif123's avatar
Ksaif123's avatar Ksaif1236yrs agoGeneral
0
4
lav's avatar

Show a search tab and pagination in JQuery

Table Responsive is not working. What am I saying, search tab and pagination not showing in the table? $( document ).ready(function() { $('#tripType').change(function(){ var res=''; var orders = <?php echo json_encode($orderdetail); ?>; res+='<div class="table-responsive"><table id="orders" class

lav's avatar
lav's avatar lav6yrs agoLaravel
2
1
Last reply by lav 6yrs ago
sohexaxok's avatar

Pagination or chunk?

Hi, I was reading in the docs and found the chunk and pagination method. According to the docs chunk is used if you don't want to have too much data in memory and once, but what about pagination? That's doing the same thing right? Can someone explain the difference between them?

sohexaxok's avatar
sohexaxok's avatar sohexaxok6yrs agoGeneral
2
1
Last reply by sohexaxok 6yrs ago
mskhoshnazar's avatar

Laravel pagination, bad design maybe?

Hi @JeffreyWay I was struggling with a clean way to render simple or regular pagination based on user's agent type (mobile/desktop), and I'm beginning to think that Laravel got it wrong. paginate and simplePaginate is something that should happen at render time (in blade where we call links()) not in the controller, because it's a presentation thing. Right?

mskhoshnazar's avatar
mskhoshnazar's avatar jlrdw6yrs agoLaravel
18
1
Last reply by jlrdw 6yrs ago
thursday_dan's avatar

Scout pagination features.

Hi guys, need a bit of help with a scout pagination issue. I’ve recently added scout to a page where I was searching multiple tables, implementing multiple paginations one a single page. This works fine. $actions = Action::search($request->q)->paginate(50, ['*'], 'ac-page'); $users = User::search($request->q)->paginate(50, ['*'], 'us-page'); However, when I

thursday_dan's avatar
thursday_dan's avatar thursday_d...6yrs agoLaravel
1
1
Last reply by thursday_dan 6yrs ago
MiguelStevens's avatar

Search Package that includes multiple models, related models and pagination?

There doesn't seem to be a perfect solution out there for now, Spatie/Searchable doesn't have pagination, Scout doesn't allow looking into related models using the MySQL driver. What do you use? Is there any good solution (using mysql?)

MiguelStevens's avatar
MiguelStevens's avatar MiguelStev...6yrs agoLaravel
3
1
Last reply by MiguelStevens 6yrs ago
chim0r's avatar

Caching and Pagination without $request

Hey there, this is my route: Route::get('/', 'KategorieController@gesamt'); and this is my code: $links = Cache::remember('gesamt', 30, function() use ($aktivkat) { return Artikel::whereIn('author', $aktivkat)->where('status','publish')->orWhere('copyright', 'user')->where('status','publish')->latest()->inRandomOrder()->paginate(10);

chim0r's avatar
chim0r's avatar chim0r6yrs agoEloquent
1
1
Last reply by chim0r 6yrs ago
bryan1671's avatar

Pagination Links not working in view

I've tried everything and cannot get my laravel pagination LINKS to work. When i view the page source, all links are there, and in page source, they work when i click on them. In blade view, clicking the link does nothing. The links buttons are at the bottom of the page in view. In view, I can type in the address bar user?page=2, etc., and it works. The href links in page sourc

bryan1671's avatar
bryan1671's avatar bryan16716yrs agoLaravel
13
1
Last reply by bryan1671 6yrs ago
PetroGromovo's avatar

Error Collection::appends does not exist In pagination with mapping

Hello! In my Laravel 5.8 app I have database request with mapping, like: $paymentItems = PaymentItem ::getByStatus('C', 'payments') ->select( $this->payment_items_tb . '.*', $this->downloads_tb . '.title as payed_item_title', $this->users_tb . '.username as payment_username',

PetroGromovo's avatar
PetroGromovo's avatar PetroGromo...6yrs agoLaravel
2
1
Last reply by PetroGromovo 6yrs ago
kizinho's avatar

Need Help, i Used Infinite Scroll Pagination with laravel but getting errors

Everything is fine but those data's that loaded with Infinite Scroll Pagination , my reply button can't work on them , it will keep refreshing the page any time i clicked on only new data's

kizinho's avatar
kizinho's avatar kizinho6yrs agoLaravel
6
1
Last reply by kizinho 6yrs ago
auroralabs's avatar

Laravel Pagination Fragment Question

Hi, I have a section in my blade template for pagination that appends an ID to the URL to stop the view jumping to the top of the page. I have added the fragment block however as soon as this is added pagination no longer works. <div class="col-12_sm-12_xs-12"> {{ $rooms->fragment('property_rooms')->links() }} </div> The issue seems to be with S

auroralabs's avatar
auroralabs's avatar auroralabs6yrs agoLaravel
3
1
Last reply by auroralabs 6yrs ago
PetroGromovo's avatar

How to multiply number of rows in result set Testing pagination

Hello, Testing pagination in laravel 5 app with request $modelsList = Model ::getByStatus('A') ->get(); I have difficulties as there are too few data in Model table. If there is a way with eloquent/collection to multiply number of rows in result set with less code as possible and easy to return ? Ex : In my case I got 5 rows, as the app is at dev stage with some def

PetroGromovo's avatar
PetroGromovo's avatar Tray26yrs agoEloquent
2
1
Last reply by Tray2 6yrs ago
repulsor's avatar

Pagination and all()

I am trying to fetch all rows from a table, and use pagination, but seems like $category = ProductCategory::all()->paginate(15); Cant be done as it returns a collection. What is the right way of retrieving all results and using pagination. Is it must that I should use a where()? and what condition should I use?

repulsor's avatar
repulsor's avatar raravel6yrs agoEloquent
1
1
Last reply by raravel 6yrs ago
dionarap's avatar

Issue with browser buttons and AJax pagination

I am bringing back a set of results of Blog posts which are paginated and the pagination is controlled using AJAX to swap the pages. The problem i have is that when i click on a blog post and then click the browsers back button to return to the list of blog post results and the page i was looking at it returns to 'Page 1'. How do i rectify this issue to return to the page i was

dionarap's avatar
dionarap's avatar jlrdw7yrs agoGeneral
6
1
Last reply by jlrdw 7yrs ago
trevorpan's avatar

How to hook additional pagination symbols into paginator

Hi ~ I've found a number of posts on how to customize the out of the box pagination but want to see if you have created additional symbols for pagination. The goal is to leave the basic ❰ 1 2 3 ❱ the bottom of page results but have the below symbols roughly mid page. Have you done this? <div class="leftarrow">❰</div> <div class="rightarrow"&g

trevorpan's avatar
trevorpan's avatar jlrdw7yrs agoCode Review
4
1
Last reply by jlrdw 7yrs ago
ahmedsami's avatar

item has many relations get pagination links

i have 2 model category model and topics model category has many topics and while i get the category relation (topics) pagination it works good but how to get the pagination links ? this is my code and it works well $category->load([ 'topics' => function($query){ return $query->paginate(2); }]); but this is not workin :( $category->topics()->links()

ahmedsami's avatar
ahmedsami's avatar ahmedsami7yrs agoLaravel
2
1
Last reply by ahmedsami 7yrs ago
chrisgrim's avatar

Working with Pagination and infinite loading

Hi, I am trying to setup infinite loading in my Vue component. I realized that I needed to combine pagination with the infinite loading so it knows where to stop and start with pulling in more events as the user scrolls. I added pagination and immediately hit an issue. Pagination no longer just sends the events like get() does. When I do a return of $events with pagination I ge

chrisgrim's avatar
chrisgrim's avatar MaverickCh...7yrs agoVue
3
1
Last reply by MaverickChan 7yrs ago
iki's avatar

laravel pagination meta data not showing

hey guys , am using laravel api resources with my collection and pagination it all works fine when i return the apiresource directly but when am trying to pass the response to my custom api response function the pagination data disappear , i searched it and found that because it gets double wrapped , but i dont know how to fix it cause i need to pass it to that function , below

iki's avatar
iki's avatar iki7yrs agoLaravel
0
1
farooq's avatar

Pagination not working after posting a value to controller and gets back

I have a page with post method . I already included pagination with that page . So it works perfectly , But after post , I'm sending the pagination to same page, but it shows only one page. When I click on next page it shows "Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message" . I added my controller here . public function AssignV

farooq's avatar
farooq's avatar jlrdw7yrs agoGeneral
4
1
Last reply by jlrdw 7yrs ago
kendrick's avatar

How to check if $collection is odd, within the current pagination?

I am trying to paginate(2) users within my view. And check on every pagination "side", if the number is odd, so I can display a blank field for the odd case. So if I count 3 users, on the first pagination I would show two, and on the second 1 user and 1 space filler (because odd). Odd logic would be @foreach($users as $user) @if(!$loop->iteration % 2 == 0)

kendrick's avatar
kendrick's avatar splendidke...7yrs agoLaravel
22
1
Last reply by splendidkeen 7yrs ago
mancoeg's avatar

filter data with pagination in laravel 5.4.36

i send an array with my keywords to appends() method and it works fine but it fails when click any other page in pagination links. error: DecryptException the payload is invalid. Any suggestion CONTROLLER $leads = new Lead; $queries = []; $columns = [ 'state_id', 'assigned_to' ]; foreach($columns as $column){ if(request()->has($colum

mancoeg's avatar
mancoeg's avatar Snapey7yrs agoLaravel
7
1
Last reply by Snapey 7yrs ago
galih56's avatar

Why my pagination is not styled?

I make a view with a simple pagination. public function index() { $data = new Ruangrapat(); $data = $data->paginate(7); return view('ajax-result.ruangrapat.index')->with('data', $data); } The data will be displayed on a table and i use ->link for pagination buttons.But when i click 1 of them.The table will show the page but the page wi

galih56's avatar
galih56's avatar jlrdw7yrs agoLaravel
3
1
Last reply by jlrdw 7yrs ago
Crazylife's avatar

How to limit the link of pagination to be displayed?

I want to show less page link for the pagination, by default it looks like < 1 2 3 4 5 6 7 8 ... 100 101 > < 1 2 ... 8 9 10 11 12 13 14 ... 100 101 > How can i make it in this way? < 1 2 3 4 5 ... 101 > < 1 ... 8 9 10 11 ...101 > This is my code @if ($paginator->hasPages()) <ul class="pagination"> {{-- Previous Page Link

Crazylife's avatar
Crazylife's avatar YeZawHein7yrs agoGeneral
4
1
Last reply by YeZawHein 7yrs ago
milosradic's avatar

Problem with pagination in combination with adding new records

Hi all, I have a problem with my pagination. I have posts that are paginated (10 per page - i have load more button on page and it loads next 10 posts on same page etc.) and users on website can add new posts. The problem is when User1 load first 10 posts and User2 creates for example 3 posts, then, when User1 loads next 10 posts, first 3 posts in second 10 posts are already lo

milosradic's avatar
milosradic's avatar milosradic6yrs agoLaravel
3
1
Last reply by milosradic 6yrs ago
Conixs's avatar

Laravel pagination as load more button

Hello everyone, I'm trying to use DataTables CDN to display my data without pagination, but with a load more button. Thus, I found out about it on website and tried to implement it as follow: <script type="text/javascript" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script> <script type="text/javascript" sr

Conixs's avatar
Conixs's avatar Conixs7yrs agoLaravel
7
1
Last reply by Conixs 7yrs ago
Robert_B's avatar

onEachSide(2) in pagination not working for me in Laravel 5.8

This is my first post, hello everybody. Today I have a problem with settings pagination I still get all links :(. My controller $fundations = Fundation::orderBy('id', 'desc')->paginate(1); return view('admin.fundation.index', ['fundations' => $fundations]); My view {{ $fundations->onEachSide(3)->links() }} <!-- simple version not working to --> {!! $

Robert_B's avatar
Robert_B's avatar meduz11mos agoLaravel
4
2
Last reply by meduz 11mos ago
xaad67's avatar

Laravel 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 there first letter like In character A all the users starting with A must be there same with A-Z

xaad67's avatar
xaad67's avatar diegoaurin...7yrs agoLaravel
1
1
Last reply by diegoaurino 7yrs ago
dionarap's avatar

Pagination and sortby

I am bringing back a list of products and i have a sortby select list that users can order the products on. The problem is that when the sortby list option is changed and then i change the page on the pagination links it forgets the sortby list value and resets to the default 2nd page rather than the second page that should appear with the sortby value. For example, the defaul

dionarap's avatar
dionarap's avatar dionarap7yrs agoLaravel
7
1
Last reply by dionarap 7yrs ago
pavlen's avatar

Get pagination for full MySql and DB::select query

Hi, is there a way to use Laravel pagination in this situation : Query for full mysql search : $key = ' test word'; $q = DB::select(' SELECT * , MATCH(col 1,col 2) AGAINST ("'.$key.'" IN BOOLEAN MODE) AS score FROM test WHERE MATCH(col 1,col 2) AGAINST ("'.$key.'" IN BOOLEAN MODE)'); Query is ok, I get good results, but cant use clasic ->paginat

pavlen's avatar
pavlen's avatar pavlen7yrs agoLaravel
2
1
Last reply by pavlen 7yrs ago
eugenefvdm's avatar

Laravel Lens Only Returning 25 Items and No Pagination Links are Visible

I have created a lens as below. May I add that the big difference between this one and the one on the example page is that mine does not have a Group By clause. The issue is that only 25 items are returned! At first I thought I was going blind but then I launched a new vanilla Laravel 5.8 project with Nova 2.0 and the issue is still there. { return $request->with

eugenefvdm's avatar
eugenefvdm's avatar eugenefvdm7yrs agoNova
0
1
Penaf's avatar

Pagination for 2 relations

Hello, Having 4 models where all include an id and a name User Author Multimedia Documents I'm linking the User model to the Author model by the email field. On the user profile I'm trying to display a count of all documents and multimedia that user submited as well as the last 10 multimediaand last 10 documents submitted (trying to do it with pagination or later if I see it'

Penaf's avatar
Penaf's avatar Penaf7yrs agoEloquent
2
1
Last reply by Penaf 7yrs ago
Dev0ps's avatar

Laravel pagination is not working after first page on server

Pagination working fine in localhost but not working on the production localhost http://127.0.0.1:8000/Admin/CRUD/U1/Index?page=2 server https://domain.com/Admin/CRUD/U1/Index?page=2

Dev0ps's avatar
Dev0ps's avatar Dev0ps7yrs agoLaravel
1
1
Last reply by Dev0ps 7yrs ago
bufferoverflow's avatar

Laravel pagination links reset the GET query

I have a form in a Real Estate website that searches for properties with filters (parameters) like rooms, baths, province... I print the results using pagination ->paginate(6). The search goes well and the results show up well filtered, but when I click on another page all the parameters get replaced for ?page=2. When I do a search: /properties/search?type=terrain&servic

bufferoverflow's avatar
bufferoverflow's avatar s4muel7yrs agoLaravel
2
1
Last reply by s4muel 7yrs ago
twiggy99's avatar

GET params are empty and its stopping the pagination from working

I have the following route set-up: Route::namespace('Admin')->prefix('admin')->name('admin.')->middleware(['auth', 'auth.admin'])->group(function () { Route::prefix('users')->group(function() { Route::get('', 'UserController@index')->name('user'); Route::get('/view/{id}', 'UserController@view')->name('user.view'); Route::get('/edit/{id}', 'U

twiggy99's avatar
twiggy99's avatar munazzil7yrs agoLaravel
3
1
Last reply by munazzil 7yrs ago
huzoorbux's avatar

fullcalendar events extract from a url with pagination

I have integrated fullcalendar and extracting all events in one go but how can i give a source url to fullcalendar and it manage pagination itself with eventSources My code: <template> <full-calendar ref="calendar" :config="config" :events="events" ></full-calendar> </template> <script> export default

huzoorbux's avatar
huzoorbux's avatar Fuhrn5yrs agoVue
2
1
Last reply by Fuhrn 5yrs ago
boneill81's avatar

Retrieve all items using pagination

Hi Guys, I have a useful and clean search method which builds up an eloquent query based on attributes that are sent to it. At the minute it uses get() and works fine. I now want to add in pagination which again works. However at the minute I am doing the following: if (!empty($parameters['page'])) { $results = $query->with('customAttributes')->orderBy('created_at',

boneill81's avatar
boneill81's avatar C-ArenA2yrs agoLaravel
8
60
Last reply by C-ArenA 2yrs ago
jarrodestepp's avatar

Laravel 5.7 Pagination Error - Only First Link Works

I have Laravel 5.7 latest installed and I have run into a problem that I cannot seem to solve. I made this post on StackOverflow: https://stackoverflow.com/questions/53845160/laravel-5-7-latest-pagination-bug-stays-on-1st-page-only-no-matter-what-pagi which has my picture with the JSON response and information on the issue, but to be quick, whenever you click 2 or 3 on the pagi

jarrodestepp's avatar
jarrodestepp's avatar jarrodeste...7yrs agoLaravel
47
3
Last reply by jarrodestepp 7yrs ago
Shawdow's avatar

This page isn’t working 127.0.0.1 redirected you too many times pagination error

adding the pagination for filters when it redirects to second page returns error This page isn’t working 127.0.0.1 redirected you too many times. controller file function category(Request $request){ $pro_category = $request->input('category'); $flag = $request->input('flag'); $pro_category = category:where('pro_category', $pro_category )->pag

Shawdow's avatar
Shawdow's avatar Shawdow7yrs agoLaravel
6
1
Last reply by Shawdow 7yrs ago
LTKort's avatar

Simplify Eloquent / Laravel with multiple filters and pagination?

My question is about simplifyng multiple Eloquent queries that work with Laravel pagination. I am building a Laravel website, on this website people can share certain recipes. I have multiple variables that members can search, filter and look trough. So members can post recipes and add: - Type - Duration - Country - Platform The idea is that there is page with all the recipes,

LTKort's avatar
LTKort's avatar jlrdw7yrs agoLaravel
1
1
Last reply by jlrdw 7yrs ago
petritr's avatar

Add offset to pagination

I have the following <pagination :meta_data="meta_data" :offset="5" v-on:next="fetchLogs"></pagination> How can i add offset to my pagination so i got 5.. 6 7 8 .. 9 Any help with this

petritr's avatar
petritr's avatar petritr7yrs agoVue
4
1
Last reply by petritr 7yrs ago
HUGE_DICK_10_INCHES's avatar

Returning pagination data as model collection

Is there a way to get pagination data inside collection? return response()-> json( User::with(['posts' => function($q) { $q->paginate(5); }, 'posts.comments' => function($q) { $q->paginate(5, ['*'], 'commentsPage', request('commentsPage')); }]) ->where('username', request('username')) ->firstOrFail() ); I need to pass th

HUGE_DICK_10_INCHES's avatar
HUGE_DICK_10_INCHES's avatar Snapey7yrs agoLaravel
3
1
Last reply by Snapey 7yrs ago
Palak27's avatar

default pagination with searching

i want to use search with default pagination method. the problem is that default paginate method is get and when i implement search i have to make it post after that if i click on next page it gives method not allowed exception. my controller code is as below public function getproductListData(Request $request) { $input = $request->all(); $filter = $input[

Palak27's avatar
Palak27's avatar jlrdw7yrs agoEloquent
6
1
Last reply by jlrdw 7yrs ago
partabsaifzakir's avatar

Can't See All Option In Dropdown Because Of Pagination

I'm using Laravel 5.7 & VueJs 2.5.* ... I did pagination for my invoice as well as vendor table. i have a create invoice form in which i have dropdown option for selecting vendors, i have more than 20 vendors, after doing pagination i see in my form i have only 10 vendors in my dropdown option... I don't know how to fix this issue. Did Pagination Like this: In HTML <

partabsaifzakir's avatar
partabsaifzakir's avatar partabsaif...7yrs agoLaravel
6
1
Last reply by partabsaifzakir 7yrs ago
Gerry's avatar

New design. Is pagination missing on long discussion threads?

Love the new design. :D Don't know if it is just me on Desktop but Is pagination now missing on long discussion threads?

Gerry's avatar
Gerry's avatar click7yrs agoFeedback
5
1
Last reply by click 7yrs ago
Smsma's avatar

pagination not work

in controller public function getFaqs() { if (config('app.locale') === 'en') { $data = Faq::get(); foreach ($data as $value) { return [ 'id' => $value->id, 'question' => $value->translate('en')->question, 'answer' => $value->translate('

Smsma's avatar
Smsma's avatar Sergiu177yrs agoLaravel
1
1
Last reply by Sergiu17 7yrs ago
ahoi's avatar

Pagination on API Ressource

Hi everybody, I wrote a little API Ressource for my User's model: use Illuminate\Http\Resources\Json\ResourceCollection; class User extends ResourceCollection { /** * Transform the resource collection into an array. * * @param \Illuminate\Http\Request $request * * @return array */ public function toArray($request) { return [

ahoi's avatar
ahoi's avatar ahoi7yrs agoEloquent
1
1
Last reply by ahoi 7yrs 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.