Questions tagged [laravel-paginate]

Using pagination in Laravel Framework

Using pagination in Laravel Framework

39 questions
0
votes
1 answer

How can I improve my query for not to get "PHP Fatal error: Allowed memory size" (Ordering and paginating in laravel 5.2)

I have a several items called posters that have logs. I want to order that posters by the date creation of these logs. I have a model called Poster with this code: class Poster extends Model { protected $table = 'posters'; public function…
Juan Lopez
  • 361
  • 1
  • 3
  • 16
0
votes
1 answer

laravel 5.4 pagination issue invalid argument supplied for foreach()

I have around 50 objects in an array. $user = User::with('abc','def','ghi','jkl','mno','pqr') ->where([['id', '<>', Auth::user()->id],['role', '<>', 2]])->simplePaginate(15); $users = json_decode($user,true); Have I placed…
0
votes
1 answer

Method render does not exist laravel pagination

$page = Question::paginate(10); dd($page); Here the pagination working very well but when i use pagination with other models relations then its produce the paginate result but pagination links not appear because its produce error $questions =…
Jitendra
  • 558
  • 8
  • 23
0
votes
1 answer

Laravel Pagination works only on the first page

Code in this function is executed by ajax call. I have pagination like this: { $id=$_GET['data']; User::where('votes', '>', $id)->paginate(15); } It works fine on the first page, however on the second page it does not find the…
0
votes
2 answers

Laravel paginate() on custom static functions

I want to paginate a custom static function. When using Eloquent goes like this People::paginate(5); and paginates the results. I need to do the same for this static function People::getOwners();
Makis
  • 1,214
  • 3
  • 16
  • 40
0
votes
2 answers

How to do pagination in Many to Many in Eloquent?

I have two tables Posts and Tags with many to many relation. I need to retrieve all posts by some tag and paginate it. Is it possible to do with paginate method or I need to create a new instance of Paginator and do everything by hand? P.S. Need…
user1692333
  • 2,461
  • 5
  • 32
  • 64
0
votes
2 answers

Laravel loading two models into one list

I have 3 models: User - have many Comments Article - belongs to User Comment - belongs to User, Article In user profile I would like to show all paginated actions of given user. What is best and most effective way to do it?
0
votes
2 answers

JQuery on click event works just one time

I'm having a problem with the click event on paginate bar. It run one time. Example: I have create a paginated view using Laravel.I'm trying to do when user clicks on the paginate numbers, empty the container div and add the new HTML to it using…
Harshana Narangoda
  • 775
  • 1
  • 8
  • 23
-2
votes
1 answer

Second page of pagination link is sending to original page in laravel

I have a form for searching data on search.blade.php (url :/search) and sending result to another view on the same URL. when I click on the 2nd link of Pagination Link bar(2 in the image) then it redirects from /search to /search?page=2 and no data…
1 2
3