public function edit() { // dd(Helper::test()); $attrs = Attribute::find(Input::get('id')); $attrSets = AttributeSet::get(['id', 'attr_set'])->toArray(); $attr_types = AttributeType::all(); $action = route("admin.attrs.save"); return view(Config('constants.adminAttrView') . '.addEdit', compact('attrs', 'attrSets', 'action', 'attr_types')); }
public function add() { $prod_types = []; $prodTy = ProductType::get(['id', 'type'])->toArray(); foreach ($prodTy as $prodT) { $prod_types[$prodT['id']] = $prodT['type']; } $attr_sets = []; $attrS = AttributeSet::get(['id', 'attr_set'])->toArray(); foreach ($attrS as $attr) { $attr_sets[$attr['id']] = $attr['attr_set']; } $action = route("admin.products.save"); return view(Config('constants.adminProductView') . '.add', compact('prod_types', 'attr_sets', 'action')); }
public function add() { $prod_types = []; $prodTy = ProductType::get(['id', 'type'])->toArray(); foreach ($prodTy as $prodT) { $prod_types[$prodT['id']] = $prodT['type']; } $attr_sets = []; $attrS = AttributeSet::get(['id', 'attr_set'])->toArray(); foreach ($attrS as $attr) { $attr_sets[$attr['id']] = $attr['attr_set']; } // // $brandCats = []; // $brands = Category::findBySlug("brand-name")->getDescendants(1, ['id', 'category'])->toHierarchy()->toArray(); // foreach ($brands as $brand) { // $brandCats[$brand['id']] = $brand['category']; // } $action = route("admin.products.save"); return view(Config('constants.adminProductView') . '.add', compact('prod_types', 'attr_sets', 'action')); }