I'm developing with DataTables in Laravel and trying to make an object manually using
collect() to create a collection. When I push the collection into the DataTable, there is something wrong, and I can't call my object with this
After I get the error with that, I already tried to call an attribute with
$object['attribute'], and it works well.
Can someone give me insight about the differences and how I can convert
This is my query to create object
$result = collect(); $item = collect([ 'row' => ($key+1), 'item_id' => $value->uid, 'item' => $value->nama_item, 'sub_kategori' => $value->sub_jenis_item->sub_jenis_item, 'kategori' => $value->jenis_item->jenis_item, 'gudang_id' => $id_gudang ]); $result->push($item);