/** * Run the database seeds. * * @return void */ public function run() { $version = Version::all()->first(); $champions = $this->getChampions(); Model::unguard(); foreach ($champions['keys'] as $key) { $img = "http://ddragon.leagueoflegends.com/cdn/" . $version->release . "/img/champion/" . $champions['data'][$key]['key'] . ".png"; Champion::create(['riot_id' => $champions['data'][$key]['id'], 'name' => $champions['data'][$key]['name'], 'title' => $champions['data'][$key]['title'], 'key' => $champions['data'][$key]['key'], 'image' => $img, 'lore' => $champions['data'][$key]['lore']]); } }
/** * 获取APP的版本信息 * @method getVersion * @return [type] [description] */ public function getVersions() { $infos = Version::all(); return view('app_version')->with('infos', $infos); }