How to group by multiple columns in Laravel Query Builder?By Hardik Savani | June 12, 2016 | | 17041 Viewer | Category : Laravel
Sometimes we may require to add group by with multiple columns, if we have mysql query then we can do it easily by using sql query. But if you want to give multiple columns in groupBy() of Laravel Query Builder then you can give by comma separated values as bellow example.
$data = DB::table("items_count")
,DB::raw("SUM(items_count.quantity) as total_quantity"))
- Magento 2 - How to solve one or more indexers are invalid by command line?
- How to set config file value in Laravel 5?
- Ajax Image Upload using PHP and jQuery Example from scratch
- How to create responsive menu in html/PHP ?
- Laravel 5 dynamic autocomplete search using select2 JS Ajax - Part 1
- How to integrate stripe payment gateway in Laravel 5.4 Application ?
- Crop, Resize, Frames etc on selected image in php using Aviary
- Laravel 5 Stripe example using Laravel Cashier from Scratch