Questions tagged [laravel-paginate]

Using pagination in Laravel Framework

Using pagination in Laravel Framework

39 questions
16
votes
4 answers

Laravel How to display $hidden attribute on model on paginate

I'm using Laravel 5.5. I read about this and know this function and it works makeVisible $hidden = ['password', 'remember_token', 'email']; I can display email using $profile =…
Goper Leo Zosa
  • 1,185
  • 3
  • 15
  • 33
8
votes
2 answers

Syntax error or access violation: 1140 Mixing of GROUP columns laravel

I have written this query with pagination in it $items = Item::select('items.*', 'sub_category_name', 'category_name', 'sub_category_slug', 'category_slug') ->join('sub_categories AS sc', 'sc.sc_id', 'items.sub_category_id') …
Alex
  • 105
  • 1
  • 5
4
votes
1 answer

Laravel Pagination with eloquent Queries

I am trying to paginate my template which has a table on it. This is my function in the controller which has the eloquent queries. public function orderbydate() { $order =DB::table('sales_flat_order_items as s') …
Jay Desai
  • 475
  • 3
  • 10
  • 27
4
votes
3 answers

Laravel sortBy paginate

I have a posts table and comments table, comment belongs to post, and I have the relationship setup in Post and Comment model. I did sort posts by the number of comments of each post like this: $posts =…
dulan
  • 1,584
  • 6
  • 22
  • 50
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
1 answer

Can't use paginate after using switch. - Laravel

I want to use the switch before using paginate. But am getting this error in my view - Call to undefined method Illuminate\Database\Eloquent\Builder::links(). My Code - MyController.php $var = User::select('somefield',…
Piyush
  • 62
  • 14
2
votes
1 answer

Paginate doesn't work as expected uisng laravel and jq

I am working on a filtering data. As there is and if someone start typing I am calling jq function to send a request to my controller. It is working fine. Even I am getting filtered data as well. But if I click on page 2 then it affects a…
Saurabh Gupte
  • 238
  • 1
  • 3
  • 17
2
votes
0 answers

How to use laravel pagination outside laravel

I'm currently working on a project that I need to paginate some SQL results. I'm using the Illuminate/Pagination package that comes with laravel. The package was loaded into my using composer (PHP dependency manager). But I'm having issue using the…
Akeem
  • 27
  • 6
2
votes
2 answers

Slim 3 pagination with Twig view using Eloquent ORM

I'm using Twig view for my slim 3 application but I don't know how to make pagination using the eloquent ORM below is my code. MODEL: namespace App\Models; use Illuminate\Database\Eloquent\Model; class Todo extends Model { protected $table =…
pal3
  • 241
  • 1
  • 2
  • 13
2
votes
1 answer

how to ->paginate() on a inner join Laravel 5

Trying to paginate a inner join but it does not work. This it my code $positions = DB::table('position') ->join('company', 'position.company_id', '=', 'company.id') ->select('position.*', 'company.name') ->paginate(15) …
Edvard Åkerberg
  • 2,181
  • 1
  • 26
  • 47
1
vote
0 answers

Laravel paginate not working in certain query but works in other query

As I am now putting a lot of data in my database I needed to use laravel's paginate. However, it doesn't seem to work in my other query. Is there other way? or what did I do wrong? My code is shown below Paginate Working (ExamController) $exams =…
Ralph
  • 193
  • 1
  • 4
  • 12
1
vote
1 answer

how to implement multiple pagination in single page | laravel 5.7

I have a situation where i want to implement multiple pagination in single page using laravel paginate() function. code in Controller file. $products=Product::paginate(10); $users=Users::paginate(10); return view('index',['products' => $products,…
Jigar
  • 3,055
  • 1
  • 32
  • 51
1
vote
2 answers

Laravel Eloquent Paginate Doesn't Exist Error

I'm trying to set pagination in a Laravel blade/view but it's showing an error with this message below: BadMethodCallException Method Illuminate\Database\Eloquent\Collection::paginate does not exist. Controller public function view() { $user =…
1
vote
3 answers

Paginate Laravel Collection

I have two different querys that I merge to return a collection $combinados = $histMe->merge($hist)->sortByDesc('created_at'); And I return them this way: $final = $combinados->all(); But this prints all the collection, how can I paginate this?…
1
vote
1 answer

Laravel Paginate displaying results unexpectedly

Controller function for showing all the posts on home page (works fine, I can click through and see all posts listed as expected): namespace App\Http\Controllers; use App\Post; use Illuminate\Http\Request; class PostsController extends…
Dan
  • 951
  • 1
  • 23
  • 46
1
2 3