im confused how to retrieve data from protected variable array, im already stored data on that variable but when i used it, it returns null.
protected $item_quantity = array();
protected $item_id_pallet_lib = array();
foreach ($itemsUsed as $item) {
$this->item_id_pallet_lib = $this->pallet_assembly_library
->where('status', '=', 0)
->where('item_id', '=', $item->item->id) ->pluck('item_id');
$this->item_quantity = $this->theoretical
->where('item_id', '=', $this->item_id_pallet_lib)
->pluck('quantity');
}
-------------this is my first attempt to retrieve data, but it fails and it returns null or nothing happens to my theoretical table---------
foreach ($itemsUsed as $item) {
$this->theoretical
->where('item_id', '=', $this->item_id_pallet_lib)
->update(array('quantity' => $this->item_quantity));
}