public function getInventory() { $sum_cost = $this->getTotalCost(); $total_members = $this->getTotalMember(); $inventory = Inventory::get()->toArray(); return view('inventory', compact('inventory'))->with('sum_cost', $sum_cost)->with('total_members', $total_members); }