public function itemProfile($item_id) { $iteminfo = Item::whereId($item_id)->first(); $uoms = Uom::where('active', 'Y')->get(); $catt = ItemCategory::all(); $categories = ItemCategory::all(); $categories_pack = []; foreach ($categories as $category) { $subcategories = ItemSubcategory::where('parent', $category->id)->orderBy('parent', 'asc')->lists('name'); $categories_pack[$category->id] = $subcategories; } $jsonified = json_encode($categories_pack); $data = ['categories' => $jsonified]; $inventory_types = InventoryType::all(); $bulkunits = BulkUnit::where('item_id', $item_id)->where('active', 'Active')->get(); $bulkunits2 = BulkPackaging::where('item_id', $item_id)->where('active', 'Active')->get(); $dropdownbulkunit = BulkUnit::where('item_id', $item_id)->where('type', 'base')->where('active', 'Active')->get(); $bulkid = BulkUnit::where('item_id', $item_id)->where('type', 'base')->first(); $id2 = Request::input('id'); $id = $iteminfo->id; $trapPurchaseOrder = count(PurchaseDetails::where('item_id', $id)->get()); $trapSalesOrder = count(SalesOrder::where('item_id', $id)->get()); return View('operations/profile', $data, compact('inventory_types', 'catt', 'iteminfo', 'uoms', 'subcategories', 'itemcatsub', 'bulkunits', 'bulkunits2', 'dropdownbulkunit', 'updatebulkunits', 'bulkid', 'trapPurchaseOrder', 'trapSalesOrder', 'getbasename')); }
public static function getAllCategories() { return \App\ItemCategory::all(); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $categories = ItemCategory::all(); return view('settings.item_categories.categories', compact('categories')); }
public function index() { $items = Item::all(); $catagories = ItemCategory::all(['id', 'cat_name']); return view('items.items', compact('items', 'catagories')); }