get count of column values in laravel eloquent code example Example: count column eloquent laravel $total = Post::sum('views');