Using pagination in Laravel Framework
Questions tagged [laravel-pagination]
197 questions
4
votes
1 answer
Pagination not showing after I use Resource to display data
I'm having issues with pagination after I use a resource to display data. Before this, I was using this code to display data, and the output shows the pagination as well.
Output
Controller
$All = Customers::with('order')->paginate(10);
return…

Choy
- 452
- 1
- 5
- 19
4
votes
2 answers
How to Paginate loaded relation with Laravel API resources
I need to load model relations in it's resource and paginate them.
In my case i have Category and Path models, plus CategoryResource and PathResource
The toArray method of CategoryResource is like below:
public function toArray($request)
{
…

Kareimovich
- 591
- 1
- 7
- 18
4
votes
2 answers
Laravel 5/ 5.4 paginator is not working in NGINX production environement
In my local environment i did $items = Model::paginate(10); and it worked. Then i pushed it to production and when i click on the pagination links it displays page 1 again and again. then i did dd($items). i found that the current Page property of…

Ahmed Nawaz Khan
- 1,451
- 3
- 20
- 42
4
votes
1 answer
Random characters are added in pagination links in laravel 5.2
I have a little issue, Please take a look.
I have shown some data on a page based on some condition filtering, Everything works good except Pagination. I can't add the filter parameters to the pagination links properly. i get these parameters…

Rahul Mangal
- 475
- 8
- 22
4
votes
1 answer
Call to a member function paginate() on array
I am working with Laravel5.0 . I want to add paginate() to the following function of my controller part.
public function index()
{
try{
$val=DB::connection()->getDatabaseName();
if(DB::connection()->getDatabaseName()) {
…

Erfan Ahmed
- 1,536
- 4
- 19
- 34
4
votes
1 answer
Using pretty URLs with Laravel 5.1 Pagination
I am writing a website using the Laravel 5.1 framework, and I'm trying to figure out how to use pretty URLs (pages/2 as opposed to pages?page=2). It actually surprised me that they haven't included a feature to allow this easily.
I'm also wondering,…

Forest
- 938
- 1
- 11
- 30
4
votes
1 answer
Laravel Pagination Error -- Call to undefined method stdClass::links()
I developed a laravel application and i want to paginate a view,
look my controller.
$times=DB::table('timesheets')
->leftJoin('users', 'timesheets.timesheet_user', '=',…

Jishad
- 2,876
- 8
- 33
- 62
4
votes
2 answers
Laravel pagination get variables
I have a page that list apartments depending on book dates like this
mypage.com/finder?date-from=2011-03-04&date-to=2011-03-12
Everything is right, I am getting the date-from and date-get from the url and searching the database with those values.…

notforever
- 569
- 4
- 12
- 23
3
votes
1 answer
Laravel Voyager server-side pagination links not showing
I am developing with Laravel 8.4 ("laravel/framework": "^8.40") and Voyager 1.4 ("tcg/voyager": "^1.4").
I am facing an unusual bug with Laravel Voyager. When I am activating Server-Side pagination for any BREAD, the pagination-links section is…

Md. Tanvir Hossain
- 33
- 4
3
votes
2 answers
Laravel Collection paginate does not exist
I'm trying to implement basic pagination when retrieving notifications, but I get the following error.
Method
Illuminate\Notifications\DatabaseNotificationCollection::paginate does
not exist.
public function index()
{
$messages = collect();
…

Shanediesel
- 161
- 2
- 9
3
votes
1 answer
Laravel Livewire Multiple Pagination In One Page
I'm using Laravel Livewire and here I have 3 tables that showing on one page but the problem is the pagination showing correctly but not working(the URL change to http://127.0.0.1:8000/blogpost?EnPosts=3 but the table stays on page 1).
Livewire…

user13708077
- 53
- 1
- 7
3
votes
4 answers
Display laravel Pagination links twice in a page
I have implemented a laravel pagination in one of my project where pagination is working like a charm.
I have a requirement to display a pagination links on top of the table as well as the bottom of the table.
Like this
{!! $entries->render()…

Punit Gajjar
- 4,937
- 7
- 35
- 70
3
votes
0 answers
links method does not exist using laravel pagination?
I am using pagination with Laravel 5.4 by this query.
$items = Item::with('likes')->whereStatus('1')->paginate(20);
And how i am rendering it in view
{{ $items->links() }}
this works fine on my local development,but on live serve i get this error…

Khirad Zahra
- 843
- 2
- 17
- 42
3
votes
2 answers
Laravel Custom Pagination
Having problems getting my pagination to work in Laravel 5.2 I use a foreach to generate a list of objects where each object has a certain ranking. (competition)
The first query I used was this one:
$goedeDoelen = GoedDoel::orderBy('punten',…

LucasPoignon
- 59
- 4
3
votes
2 answers
Laravel 5 how to use pagination with files list?
I have one problem with my script. I did foreach with files list but I need pagination, for example 15 files per site. What should I do now? Thanks for help :)
Controller:
$files = Storage::allFiles('/upload_file');
return…

Stanisław Szewczyk
- 105
- 1
- 3
- 11