type == 'NEW_USER' && $transform){ $res->type = 'TICKET_RECHARGE'; } return $res; } public static function getProductsByIds($ids) { return Product::getProductsByIds($ids); } public static function updateProductDefault($id, $default) { if($default){ Product::where('id','!=',0)->update(['is_default'=>0]); Product::where('id',$id)->update(['is_default'=>1]); } if($default == 0){ Product::where('id',$id)->update(['is_default'=>$default]); } } public static function updateProductEnabled($id, $enabled) { if($enabled !== false){ Product::where('id',$id)->update(['is_enabled'=>$enabled]); } } }