Exemplo n.º 1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     foreach (\MkmScraper\Set::all() as $set) {
         $result = queryMKMAPI("expansion/1/" . rawurlencode($set->name));
         foreach ($result->card as $card) {
             $record = \MkmScraper\Card::find($card->idProduct);
             if (!$record) {
                 \MkmScraper\Card::create(array("id" => $card->idProduct, "name" => $card->name[0]->productName, "id_set" => $set->id, "rarity" => $card->rarity));
             }
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     foreach (\MkmScraper\Set::all() as $set) {
         \MkmScraper\BoosterAverage::create(array("low" => $set->averageBoosterLow(), "trend" => $set->averageBooster(), "id_set" => $set->id));
     }
 }