@lbecket Ahh! thanks for attach the link. I just read it and try it.
This is the result in dd(), and yes that is what i want.
#items: array:5 [▼
"ALL IN BULAT (6TIN) 235GR" => Illuminate\Support\Collection {#1383 ▼
#items: array:4 [▼
0 => {#1387 ▼
+"Produk": "ALL IN BULAT (6TIN) 235GR"
+"Tanggal": "2022-01-15"
+"Jumlah": "182"
}
1 => {#1386 ▼
+"Produk": "ALL IN BULAT (6TIN) 235GR"
+"Tanggal": "2022-02-01"
+"Jumlah": "200"
}
2 => {#1389 ▼
+"Produk": "ALL IN BULAT (6TIN) 235GR"
+"Tanggal": "2022-03-03"
+"Jumlah": "345"
}
3 => {#1391 ▼
+"Produk": "ALL IN BULAT (6TIN) 235GR"
+"Tanggal": "2022-04-07"
+"Jumlah": "20"
}
]
#escapeWhenCastingToString: false
}
"ALL IN SEGI NEW (6TIN) 600GR" => Illuminate\Support\Collection {#1381 ▶}
"ASTOR EMBER (7 X 30 PCS)" => Illuminate\Support\Collection {#1380 ▶}
"ASTOR MINI TRUST COKLAT 10 PACK" => Illuminate\Support\Collection {#1379 ▶}
"ASTOR MINI TRUST PANDAN (10 PACK)" => Illuminate\Support\Collection {#1382 ▶}
]
But the result become different after i bring it to the blade
$data = $results->groupBy('Produk');
return DataTables::of($data)->make(true);
when i do console.log(), this is the result
{Produk: 'ALL IN BULAT (6TIN) 235GR', Tanggal: '2022-01-15', Jumlah: '182'}
Jumlah: "182"
Produk: "ALL IN BULAT (6TIN) 235GR"
Tanggal: "2022-01-15"
[[Prototype]]: Object
{Produk: 'ALL IN SEGI NEW (6TIN) 600GR', Tanggal: '2022-01-17', Jumlah: '41'}
{Produk: 'ASTOR EMBER (7 X 30 PCS)', Tanggal: '2021-02-05', Jumlah: '13'}
{Produk: 'ASTOR MINI TRUST COKLAT 10 PACK', Tanggal: '2021-02-05', Jumlah: '880'}
thats different when i do dd($data), or is there something i missed?