/** * ajax get link download. * @param $gameId * @return Response */ public function downloadLink($gameId) { //return json to ajax. $link = session()->get($gameId . '_download'); if (!$link) { $game = Game::find($gameId); $crawler = new MainCrawler(); $link = $crawler->download($game); session()->put($gameId . '_download', $link); } return response()->json(['link' => $link]); }
/** * */ public function import() { $crawler = new MainCrawler(); $crawler->import(5000); }