first(); if(!$statTree) { $this->error("Tree with specified slug does not exist!"); return 0; } if(!$statTree->is_template) { $this->error("Tree with specified slug is not a template!"); return 0; } // check pro-class and get pro uids $this->info($argv[3]); $pros = Pro::where('is_active', TRUE)->whereRaw($argv[3])->get(); $this->info(count($pros) . " pros found."); $this->info("Instantiating..."); $doneCount = 0; if(count($pros) > 0) { foreach ($pros as $pro) { $statTree->instantiateForPro($pro); $doneCount++; if($doneCount % 50 == 0) { $this->info("$doneCount / " . count($pros) . " completed."); } } $this->info("$doneCount / " . count($pros) . " completed."); } } }