public function syncACS() { $acs = app('cloudstack'); if (is_array($acs)) { return -1; } $offerings = $acs->listDiskOfferings(); $tags = []; foreach ($offerings as $offering) { // Extract a list of tags if (!isset($offering->tags)) { continue; } if (!in_array($offering->tags, $tags)) { $tags[] = $offering->tags; } } foreach ($tags as $tag) { // Create a config price and a storage tag if they don't exist. StorageType::firstOrCreate(['tag' => $tag]); SiteConfig::firstOrCreate(['parameter' => $tag . 'Price']); } return 1; }