laravel count column value code example Example: count column eloquent laravel $total = Post::sum('views');