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