Reputation: 183
I would like to add this result's total numbers.
Here is my query. It worked fine just display images.
Could you teach me how to write query and blade file please ?
public function allimg()
{
$images = ImageGallery::whereNotNull('image')->where('image', '!=', '')->limit(200.)->orderBy('id', 'desc')->get();
return view('allimg',compact('images'));
}
Upvotes: 0
Views: 329
Reputation: 35
As per Laravel Documentation under queries (See link: https://laravel.com/docs/4.2/queries)
You can use Aggregate Methods such as: count, max, min, avg and sum.
So in your case, you can use count()
Upvotes: 1
Reputation: 4684
In your blade.php
this will give you the total number of images.
{{$images->count()}}
Upvotes: 4