public function saveaddProducts() { $productcat_id = Input::get('productcat_id'); $products = json_decode(Input::get('name')); if (!empty($products)) { $catName = Productcategory::find($productcat_id)->pluck('name'); $BrandName = Productcategory::find($productcat_id)->brand->pluck('name'); //$catName = $BrandID_CatName->name; //Log area $log['products'] = "[ {$BrandName} / {$catName} ] = " . implode(' | ', $products); $log['stocktype'] = 'create'; $this->_saveActivityLog($log); } return Product::saveAll($products, $productcat_id); }