diff --git a/database/migrations/2023_10_31_081816_fix_typo_championskins.php b/database/migrations/2023_10_31_081816_fix_typo_championskins.php new file mode 100644 index 0000000..a5aae58 --- /dev/null +++ b/database/migrations/2023_10_31_081816_fix_typo_championskins.php @@ -0,0 +1,28 @@ +renameColumn('raritiy', 'rarity'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('champion_skins', function (Blueprint $table) { + $table->renameColumn('rarity', 'raritiy'); + }); + } +}; diff --git a/database/seeders/ChampionSkinSeeder.php b/database/seeders/ChampionSkinSeeder.php index ff08d31..c33ac45 100644 --- a/database/seeders/ChampionSkinSeeder.php +++ b/database/seeders/ChampionSkinSeeder.php @@ -2,6 +2,7 @@ namespace Database\Seeders; +use App\Models\Champion; use Illuminate\Database\Seeder; class ChampionSkinSeeder extends Seeder @@ -11,6 +12,12 @@ class ChampionSkinSeeder extends Seeder */ public function run(): void { - // + $championDataUrl = "http://cdn.merakianalytics.com/riot/lol/resources/latest/en-US/champions.json"; + $championData = json_decode(file_get_contents($championDataUrl), true); + + foreach ($championData as $champion) { + $championId = $champion['id']; + $championExists = Champion::where('champion_id', $championId)->first(); + } } }