Questions tagged [laravel-pagination]

Using pagination in Laravel Framework

197 questions
0
votes
1 answer

laravel-how to fetch Specified object in view?

I'm passing data to the view and I'm trying to get a Certain key from a nested object without using foreach. Help me to fetch the value of 'original' and '300' from images. { "current_page": 1, "data": [ { "id": 44, …
MAHDI
  • 1
  • 1
  • 2
0
votes
2 answers

Laravel pagination active page appears without style

I'm using Laravel pagination with ->render() or ->links() method. Everything it's fine, the only problem is with my current active page, doesn't matter is is the first one, the second one or the last page, if is the active page the style doesn't…
User1899289003
  • 850
  • 2
  • 21
  • 40
0
votes
1 answer

Get count of records matching filters Laravel pagination

I have few filters on the view page and want to show the count that matches the given conditions. Like on the product search result I have Free Shipping filter. I need the count of records matching my filters in the total record not just in the…
Munna Khan
  • 1,902
  • 1
  • 18
  • 24
0
votes
2 answers

paginate() throws error while using having() while get() shows the results

Code: if ($request->going){ if($request->lattitude && $request->longitude){ $CurrentIplat = $request->lattitude; $CurrentIplon = $request->longitude; $ads1 = DB::table('ads') ->leftJoin('categories',…
0
votes
2 answers

Laravel 5.6 Search Pagination giving error "Sorry the page cannot be found on page 2"

I am new to the Laravel Search functionality and pagination. I am using Laravel 5.6 and have search functionality. Controller Code public function search() { $users = User::whereRole_id(1)->where(function($query) { $q =…
Palak
  • 15
  • 6
0
votes
1 answer

Laravel paginate not working using with query

I can view all my posts and include their respective owner and category in the query. public function index() { $posts = Post::with('user', 'category')->get(); return response()->json([ 'posts' => $posts, ], 200); } Note: I…
Sidney Sousa
  • 3,378
  • 11
  • 48
  • 99
0
votes
1 answer

How to use Laravel Collection groupBy along with Query Pagination?

I love using Laravel's groupBy function https://laravel.com/docs/5.6/collections#method-groupby However, I cannot use it with paginate(x) function since it return a limited number of results. Groupby of SQL Query and Laravel Collections's GroupBy is…
SNaRe
  • 1,997
  • 6
  • 32
  • 68
0
votes
0 answers

pagination Laravel Scout search: SQLSTATE[42000]

hi and thanks for replies. i use : laravel-scout-mysql-driver to index and search mysql database. according to this set: 'strict'=>false the code: public function searchpages(Request $request){ $query= $request->get('query'); $adpgs=[]; …
Solivan
  • 695
  • 1
  • 8
  • 16
0
votes
1 answer

Laravel paginator in custom query

I am working on a project in laravel. I have sql queries as string in db. The queries are very important. There is no way to write them in laravel relationships because of some situation so DB::select($table->query) I wanna paginate this with…
Ozal Zarbaliyev
  • 566
  • 6
  • 22
0
votes
1 answer

laravel pagination without a model

I found this reply this for a similar question: Laravel 5 - Manual pagination what is not clear now to me is how to make the front page workin with the classic {{$items->links()}} on blade template. my controller's code is: $paginator = new…
JahStation
  • 893
  • 3
  • 15
  • 35
0
votes
0 answers

Laravel pagination does not create relative path

I am using laravel pagination but url of pagination is not relative and it appends the new url to previous url for example if my current url is "http://localhost:8080/event-home/1" then when I click on 2nd page it generates link as…
0
votes
1 answer

Force Laravel 5.4 to always start related entity pagination from page 1

I have a Post model that can have many comments. When I'm listing posts in a feed - both posts and post comments are paginated. The problem is when I visit post feed page that isn't first - post comments aren't paginated starting from the first…
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
0 answers

Laravel: remember state with pagination

I'm building a quiz application. I want the questions and the possible answers to be randomized so that when a user attempts the same quiz, he gets presented the same questions but in different order. I also want to only display one question (with…
wiwa1978
  • 2,317
  • 3
  • 31
  • 67
0
votes
1 answer

Laravel 5.2 pagination: how to decrease distance from table

I have a Laravel 5.2 application. I'm using the default Laravel pagination. All works functionally but there is quite some empty space between the last row of the table and the pagination link. See picture for an example: How can I make the empty…
wiwa1978
  • 2,317
  • 3
  • 31
  • 67