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

vtxmg's avatar

Two Pagination on same page

Hello guys.. I have two pagination in a same page !! Now I want to make both functional without affecting one another. You know that by default it use ?page=1 in url to paginate but when it did it affect another too.. so whats the solution?

vtxmg's avatar
vtxmg's avatar ounos10yrs agoEloquent
3
1
Last reply by ounos 10yrs ago
nztim's avatar

Manual pagination links (5.0/5.1)

I'm updating a L4 application to L5 which uses manual pagination and I'm trying to understand how the links work. I wrote this simple but rough example to illustrate: Route::get('events/category', function(Illuminate\Http\Request $request) { $array = []; for($i = 0; $i < 100; $i++) { $array[] = "Item#{$i}"; } // $perPage = 10; $curr

nztim's avatar
nztim's avatar nztim11yrs agoLaravel
2
1
Last reply by nztim 11yrs ago
Dewilas's avatar

2 pagination in one page Laravel4

Hello, i have index page where are 2 tabs. In the contens i loading products and categories with two pagination. then i click on page for ex. 3, pagination together show me 3 page. how to make two links like: http://domain.com/products/type?page=2 http://domain.com/products/type?page2=2 ps. i can add another variable like {{ $products->appends(['products' => 1])->links

Dewilas's avatar
Dewilas's avatar Dewilas11yrs agoLaravel
0
1
majacirkova's avatar

Pagination with Nayjest data grid

Hello , i m using Nayjest data grid , is there some option to generate pagination links from some query in Laravel 5. Pager only show number of pages without links.Do you have some examples to show me how to use it ?

majacirkova's avatar
majacirkova's avatar majacirkov...11yrs agoLaravel
9
1
Last reply by majacirkova 11yrs ago
JABirchall's avatar

Eloquent sqlsrv Join Pagination error

I'm getting this error when doing pagination on a joined query specifically when requesting any page but 1. My query: $accounts = Accounts::join('UsersData', 'Accounts.CustomerID', '=', 'UsersData.CustomerID') ->simplePaginate(20); return view('accounts', compact('accounts')); and I'm getting error: QueryException in Connection.php line 624: SQLSTATE[42000]: [Microsoft][O

JABirchall's avatar
JABirchall's avatar TrederusMa...8yrs agoEloquent
1
1
Last reply by TrederusMaximus 8yrs ago
masterakado's avatar

Laravel pagination not working with array instead of collection

I'm trying to paginate an array data set and it has proven more challenging than I thought. I'm using Laravel 5 So I have an abstract interface/repository that all my other models extend to and I created a method inside my abstract repository call paginate. I've included both use Illuminate\Pagination\Paginator; and use Illuminate\Pagination\LengthAwarePaginator; Here is the me

masterakado's avatar
masterakado's avatar kodunmi3yrs agoLaravel
35
37
Last reply by kodunmi 3yrs ago
gretschduojet's avatar

Limit with pagination on 5.6 million record table - slow search

Hello, I'm having an issue with a table that has roughly 5.6 million records. I updated mysql to use full text search on InnoDB. Is it possible to limit your query results and use pagination? Some searches are returning approximately 60k results and it's taking about 10 seconds. Also, I'm fairly new to full text searching and I'm not sure how to search on an exact email. R

gretschduojet's avatar
gretschduojet's avatar gretschduo...11yrs agoLaravel
2
1
Last reply by gretschduojet 11yrs ago
SetKyarWaLar's avatar

How do I get previous pagination data in Laravel?

I try something like that User::paginate(10); And when I click 2 via my view it's go /?page=2 and it's just show after record 10. How do I get previous pagination data?

SetKyarWaLar's avatar
SetKyarWaLar's avatar RachidLaas...11yrs agoGeneral
4
1
Last reply by RachidLaasri 11yrs ago
dzuritaa's avatar

Problem using pagination

Hello! I'm using a pagination for the first time, but I'm running to a small issue, I'm working with laravel 5 so I have the pagination in my controller like this $news= News::where('id_tipos_noticias', '=', 1)->latest('created_at')->paginate(10); return view('news.index', compact('news')); And in my view I do a foreach of the news, and its working, but when I put the c

dzuritaa's avatar
dzuritaa's avatar nobitacnt11yrs agoGeneral
2
1
Last reply by nobitacnt 11yrs ago
SCC's avatar

Pagination controls at the top of the thread

@JeffreyWay Would it be possible to also have the pagination controls at the top of the thread, it's a pain when you go in to view threads you are familiar with and have to scroll down to the bottom of page 1 to then get to the last page.

SCC's avatar
SCC's avatar Ruffles11yrs agoFeedback
5
1
Last reply by Ruffles 11yrs ago
Teranode's avatar

[L5] Pagination Issues Presented

I'm having a little problem converting the cacheTags to suit L5's Standards. Originally this was what I was using to pass pagination into the cache: /** * Builds paginate query with given parameters. * * @param array $params * @param integer $page * @param integer $perPage * * @return array */ public function buildPaginateQ

Teranode's avatar
Teranode's avatar bobbybouwm...11yrs agoGeneral
2
1
Last reply by bobbybouwmann 11yrs ago
devratna's avatar

Custom Pagination URLs L5

By Default Pagination URLs are show as localhost/something/?page=1 I want to make it like this localhost/something/page/1 Is there anyway to do it like that?

devratna's avatar
devratna's avatar bobbybouwm...11yrs agoGeneral
8
1
Last reply by bobbybouwmann 11yrs ago
MarcTroesken's avatar

L5 Pagination freaks me

Hi there, I´m playing around with L5 Pagination. I have a set of data in an array. Its an array with arrays in it and I try to paginate it like this: return new Paginator( $strings, count($strings), 2, Paginator::resolveCurrentPage(), ['path' => Paginator::resolveCurrentPath()] ); It renders the right amount of pages with links, but the data is still there (all of

MarcTroesken's avatar
MarcTroesken's avatar MarcTroesk...11yrs agoTips
2
1
Last reply by MarcTroesken 11yrs ago
Sonu's avatar

Pagination customize during search.

How can we customize pagination during searching of records when multiple parameters available @ Url. For expample I have this Url at Search http://localhost/Myadmin1/faqs/search?question=&lang=any And for paginagion i am unsig this {!! $viewCats->render() !!} My variable name and pagination function, Its works fine for a singe table. But how can i custom pagination

Sonu's avatar
Sonu's avatar arabsight11yrs agoGeneral
1
1
Last reply by arabsight 11yrs ago
Alizey's avatar

Pagination Base Url Problem

this is my home url : http://localhost/dreamJobs my problem is with my pagination when i clicks on page 2 laravel skips my root folder name and i got this url :http://localhost/dreamJobs/ But When i click On Pagination Pagination truncated My url : http://localhost/view?page=2

Alizey's avatar
Alizey's avatar Sonu11yrs agoGeneral
4
1
Last reply by Sonu 11yrs ago
Ltloafer's avatar

Displaying image on page 2 of pagination

Hi all, In my view I'm running a simple foreach loop with an image displayed within. ie @foreach ($posts as $post) @endforeach When I use pagination page 1 runs fine, but page 2 onwards won't display the image. What am I doing wrong?? Thanks in advance for any guidance! Lt

Ltloafer's avatar
Ltloafer's avatar blackbird11yrs agoGeneral
4
1
Last reply by blackbird 11yrs ago
New_Hides's avatar

Pagination Render() error

I'm wanting to use pagination but I'm getting this error when I run it: ErrorException in Builder.php line 1992: Call to undefined method Illuminate\Database\Query\Builder::render() (View: C:\wamp\www\FrameWorks\Laravel_test_folder\property_test\resources\views\properties\list.blade.php) Here is my controller: $input = Request::all(); $properties = Property::whereBetween('NoofB

New_Hides's avatar
New_Hides's avatar Ozan11yrs agoGeneral
4
1
Last reply by Ozan 11yrs ago
mangoz's avatar

Get db info with pagination

I use laravel 5 and i want to fetch some data from db (while loop) I want to show in blade template with pagination. I have controller and i want to put all code there. (in public function) How to do that ? Please, give me full example i'm newbie.

mangoz's avatar
mangoz's avatar dede0283011yrs agoRequests
1
1
Last reply by dede02830 11yrs ago
shonetow's avatar

Changing Laravel pagination

Hi! I need to change Laravels pagination just a little bit. Current pagination looks like this: < 1 2 ... 5 6 7 8 9 10 11 ... 20 21 > This is to many numbers for my need, so I need to look like this: <Previous 1 ... 6 7 8 9 10 ... 21 Next> Is there some easy way to do this? Tnx

shonetow's avatar
shonetow's avatar shonetow11yrs agoGeneral
1
1
Last reply by shonetow 11yrs ago
shawnyv's avatar

Check for Pagination?

Hi all, I'm trying to reuse a view across a few different controller methods / routes, and it's working fine except that I want to paginate all but 1 of them. I have one method that calls a collection, then does some work on it, and then outputs it to the page. I can't figure out how to paginate this correctly, and if I just pass a full collection the "$collection->ren

shawnyv's avatar
shawnyv's avatar jmfs11yrs agoGeneral
2
1
Last reply by jmfs 11yrs ago
sesc360's avatar

API Pagination

Hi all, I want to paginate my json output of an API I wrote. Therefore I use the pagination helpers of laravel. the index method looks like this: public function index() { $limit = Input::get('limit') ? : 10; $incidents = Incident::paginate($limit); if( ! $incidents) { return Response::json([ 'error' => [

sesc360's avatar
sesc360's avatar taijuten11yrs agoGeneral
1
1
Last reply by taijuten 11yrs ago
dede02830's avatar

Keep pagination after action

Hello, I have a functionnal pagination. But i have a tab with lines and buttons and when i click on this button ( this button was link to other action in controller), i go to the first page of my pagination. for exemple i am on the 4 pagination page and when i click on this button, this function was achieve and after this i was redirect on the 1rst page of the pagination... How

dede02830's avatar
dede02830's avatar dede0283011yrs agoGeneral
0
1
brentxscholl's avatar

Pagination not working in Forge, but works on local machine

I'm using Laravel 4.2.16 simplePaginate in my project to create a facebook style image viewer. On my local VM it works flawlessly. However, when I install my repository onto my live server using forge, this is the only thing on the site that now does not work. On my live server the next & prev links are not showing. I'm using a custom pagination layout. Here is my code: Con

brentxscholl's avatar
brentxscholl's avatar brentxscho...11yrs agoForge
1
1
Last reply by brentxscholl 11yrs ago
Ranjeet's avatar

pagination in laravel 5

Iam unable to make pagination for following conditions.I think i cannot use paginate()function given by laravel for following conditions.How can i make pagination for this conditions .please help me... iam thinking to use array_slice() method.But how to display next items in page if i use array_slice()method.Or is their any easy to to do this public function getReportsBasedOnD

Ranjeet's avatar
Ranjeet's avatar Ranjeet11yrs agoGeneral
2
1
Last reply by Ranjeet 11yrs ago
Akeno's avatar

Many-to-many -> Pagination with pivot table data

Hi, I have a many-to-many relation: locations messages location_messages Now, I want to paginate all of the messages from a Location: $location->messages()->paginate(10); That works but there is one problem: Inside my pivot table, there is some important data I need. The way from above does get this data, but it does not put it within a "->pivot" attribute.

Akeno's avatar
Akeno's avatar ben_s24710yrs agoGeneral
16
1
Last reply by ben_s247 10yrs ago
Sonu's avatar

Pagination Truncates My Base Url

I Am Working On LocalHost And this is My BaseUrl http://localhost/laravelAdmin But When i click On Pagination Pagination truncated My url . Here Is My Url At LocalHost http://localhost/laravelAdmin/users/view but when i click on any page pagination Truncates My Folder Name And Return Me This Url And Page Not Opens http://localhost/users/view?page=2 Its Skips My Folder Name

Sonu's avatar
Sonu's avatar Sonu11yrs agoGeneral
7
1
Last reply by Sonu 11yrs ago
Sonu's avatar

Laravel 5 Pagination Problem Help Needed.

I am Facing A Pagination Problem At My View Page Here is My Function public function view($id) { $useriformation = DB::table('users')->paginate(3); return view('views')->with('useriformation', $useriformation); } But when i try to Generate Pagination At My View {!! $value->render() !!} I Got This Error Call to undefined method stdClass::render()

Sonu's avatar
Sonu's avatar Sonu11yrs agoGeneral
3
1
Last reply by Sonu 11yrs ago
amarsyla's avatar

Changing simple pagination next/prev labels

Hello, I don't have much knowledge on PHP, and I am fresh new to Laravel. I have successfully implemented the Eloquent pagination, and I am rendering the pagination with this code: {!! $colleagues->appends(Request::except('page'))->render() !!} Right now, the previous and next links are represented with '<<' and '>>'. I'd like to change that. I know how to do

amarsyla's avatar
amarsyla's avatar Rjs3710yrs agoGeneral
6
2
Last reply by Rjs37 10yrs ago
ahmedash95's avatar

Pagination Query With Cache

Hello everybody I'm trying to cache search results with Pagination but i always get error this is my code $result = Cache::remember($stmt, 1440, function() use($title,$section,$state,$city) { $services = Services::where('service_name', 'LIKE', '%' . $title . '%') ->where('service_city', 'LIKE', '%'.$city.'%') ->where('s

ahmedash95's avatar
ahmedash95's avatar ahmedash9511yrs agoGeneral
0
1
SP1966's avatar

Thread Pagination

On multi-page threads that you've already viewed earlier it would be nice to have the pagination links at both the top and bottom of the screen so as to not need to scroll to the bottom simply to click a link to the last page. On the other hand it would be great to be automatically taken to the newest post in the thread but that would be a lot more work.

SP1966's avatar
SP1966's avatar SP196611yrs agoFeedback
0
1
silence's avatar

Pagination templating support

Hello! I created today a small package to handle the pagination through templates, similar to what we did in Laravel 4. Here is the link: https://github.com/claycomponents/bladepagination So far, it has support for Bootstrap, Materialize and Foundation and you can create your own theme as well. It's only a proof of concept. What do you guys think? If you like it, I'll be adding

silence's avatar
silence's avatar silence11yrs agoGeneral
1
2
Last reply by silence 11yrs ago
keche's avatar

Simple pagination help

I'm new to laravel and I i need help.I just need someone to explain me simple pagination in laravel 5.How to get prev and next link and how to set up my controller.

keche's avatar
keche's avatar bestmomo11yrs agoGeneral
1
1
Last reply by bestmomo 11yrs ago
bestmomo's avatar

Pagination page 1

With the pagination we have for a same page 2 urls : http://mysite/ http://mysite/?page=1 Isn't there something wrong for referencement ?

bestmomo's avatar
bestmomo's avatar bestmomo11yrs agoGeneral
4
1
Last reply by bestmomo 11yrs ago
aligajani's avatar

Laravel 4.2 Pagination on New Collection Doesn't Work As Expected

I created a new Collection, paginating as one would and passing it to the view. But there's one problem. The pagination works as expected on page 1, but when I press next, it goes on page 2, but there's no content there, nor the pagination links. The code is as above. //pull all threads ordered by decreasing date $all_threads = Thread::orderBy('updated_at', 'DE

aligajani's avatar
aligajani's avatar aligajani11yrs agoGeneral
0
1
crazymonster's avatar

L5: Pagination Problem

Hello, guys. My Controller: use Illuminate\Pagination\LengthAwarePaginator as Pagination; $count = count($singers); $singers = new Pagination($singers, $count, 2); return view('singers.view', compact("countries", "singers")); My View: $singers->setPath('/admin/singers/view'); echo $singers->appends(['visible' => '', 'countr

crazymonster's avatar
crazymonster's avatar crazymonst...11yrs agoGeneral
1
1
Last reply by crazymonster 11yrs ago
efcoders's avatar

Custom pagination in laravel5

Hi All is there any simple example of custom pagination in laravel5? Thnaks

efcoders's avatar
efcoders's avatar jlrdw6yrs agoGeneral
13
1
Last reply by jlrdw 6yrs ago
bestmomo's avatar

Pagination trailing slash

Hi guys ! L5 pagination generates url with "/?" (it was not in L4), that is not managed by all servers (for example my WAMP server doesn't like it). In my projects I always remove this trailing slash and all is fine. But I've read that "/?" is a correct syntax. So I read the ugly RFC 3986 and I didn't find any reference to this trailing slash. So I wonder ab

bestmomo's avatar
bestmomo's avatar Mario Nava11yrs agoGeneral
14
1
Last reply by Mario Nava 11yrs ago
chrisblackwell's avatar

Change Pagination Markup (L5)

Does anyone know how to override the markup for the pagination to match Foundation 5? I know this use to be doable in Laravel 4 but can't seem to get it working in Laravel 5.

chrisblackwell's avatar
chrisblackwell's avatar erikbelusi...10yrs agoGeneral
2
1
Last reply by erikbelusic 10yrs ago
Anotheruser's avatar

[L4.2] distinct() and pagination returns total number of results not distinct total

Hi I am wondering what the best solution to this problem is? When running: $posts = $company->posts() ->distinct() ->paginate(5); The 'total' returned and used by the pagination equals the total number of posts (55) and not the distinct number of posts (22). I have seen a number of posts online regarding the issue and there is men

Anotheruser's avatar
Anotheruser's avatar martinbean2yrs agoGeneral
10
2
Last reply by martinbean 2yrs ago
tfevens's avatar

Pagination & Collections

In my app I'm currently displaying a list of articles, returned as an instance of Illuminate\Database\Eloquent\Collection. I can use $articles->shift() to grab the first article, and remove that from the Collection (displaying 2 articles, then an info box, and then looping through the remaining articles) without running into any issues. However, now that I want to add pagina

tfevens's avatar
tfevens's avatar tfevens11yrs agoGeneral
4
1
Last reply by tfevens 11yrs ago
sauladam's avatar

Pagination and urlencoded arrays

I want to filter my results, say, by a status. I want all posts that have one of the given statuses. I pass the statuses array through the query string (actually coming from a form with a multi-select): posts?statuses[0]=new I pass the statuses array to the pagination renderer with $posts->prepends($statuses)->render(); And Laravel of course urlencodes the the URLs: post

sauladam's avatar
sauladam's avatar Bebbolus9yrs agoGeneral
8
1
Last reply by Bebbolus 9yrs ago
rikarsen's avatar

Custom pagination view

Hi. I want to change L5 pagination view. This is the pagination code: {!! $categories->render() !!} This is view: <ul class="pagination"> <li class="disabled"><span>«</span></li> <li class="active"><span>1</span></li> <li><a href="categories?page=2">2</a&

rikarsen's avatar
rikarsen's avatar JarekTkacz...11yrs agoGeneral
3
1
Last reply by JarekTkaczyk 11yrs ago
CoedNaked's avatar

Help with Pagination please.

/* works */ Route::get('/', function() { $users = OMM\Models\User::paginate(4); return view('matches.test', ['users'=> $users]); }); /* Does not work */ Route::get('match/test', function() { $users = OMM\Models\User::paginate(4); return view('matches.test', ['users'=> $users]); }); In the 2nd example the "page" is not being passed using Debugbar request_quer

CoedNaked's avatar
CoedNaked's avatar CoedNaked11yrs agoGeneral
1
1
Last reply by CoedNaked 11yrs ago
mstnorris's avatar

Forum pagination links at the top of the page

When viewing the forum or a specific forum thread that spans multiple pages, would you please add pagination links to the top because as the original poster of the thread, I don't necessarily need to re-read over everything that has been said before I want to see the latest post from someone else. I don't know if others agree, but to me it makes sense and saves a couple of clic

mstnorris's avatar
mstnorris's avatar mstnorris11yrs agoFeedback
0
1
mstnorris's avatar

Bug in Forum Search Pagination URL

There is a bug in the Laracasts Forum. Pagination links don't generate the correct the URL, they are missing "discuss" before the arguments. Steps to reproduce: Go to http://laracasts.com/discuss Enter "form" in the search field (this returns enough results so that it is paginated) Scroll to the bottom of the list and click the ">>" link to

mstnorris's avatar
mstnorris's avatar mstnorris11yrs agoFeedback
2
1
Last reply by mstnorris 11yrs ago
DanSmith's avatar

Package - Zurb Foundation style pagination

Hi all, I've just started working on this to override the default Bootstrap style that Laravel 5 applies to pagination. Hope it's of use to someone. https://packagist.org/packages/dansmith/laravel5-foundation

DanSmith's avatar
DanSmith's avatar DanSmith11yrs agoGeneral
6
9
Last reply by DanSmith 11yrs ago
Ozan's avatar

Laravel 5 Custom Views For Pagination

I tried to make a custom pagination links view. So far i have got this: <?php namespace App\Kurt; use Illuminate\Pagination\BootstrapThreePresenter; class CustomPaginationLinks extends BootstrapThreePresenter { //<li><a href="#">&laquo;</a></li> //<li><a href="#">1</a></li> //<li><span>2</span></li&

Ozan's avatar
Ozan's avatar impbob9yrs agoGeneral
7
1
Last reply by impbob 9yrs ago
yayuj's avatar

Pagination on the top

I just realized that the pagination is only on the bottom, I need to scroll in order to change the page. It would be nice to have the pagination on the top, even better bellow the thread, and once in the next page, the thread stays visible as well.

yayuj's avatar
yayuj's avatar yayuj11yrs agoFeedback
4
1
Last reply by yayuj 11yrs ago
cskiwi's avatar

adding Pagination messes up the output

hi, I'm trying to get some chats from my DB. but when adding pagination it messes up the output: So by using the following code, I get the following output: code echo 'First ouptut'; $chats = Auth::User()->Chats; var_dump(ChatTransformer::transformCollection($chats)); echo 'Second ouptut'; $limit = Input::get( 'limit', '5' ); $chats = Auth::User(

cskiwi's avatar
cskiwi's avatar cskiwi11yrs agoGeneral
5
1
Last reply by cskiwi 11yrs ago
abhijitghogre's avatar

Laravel 5 - Manual pagination

Paginator::make() method doesn't exist in Pagination class anymore. Is there any workaround to make manual pagination work in Laravel 5?

abhijitghogre's avatar
abhijitghogre's avatar Arda10yrs agoRequests
11
1
Last reply by Arda 10yrs 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.