fix: fix typo in skins database

This commit is contained in:
Rico van Zelst
2023-10-31 09:19:14 +01:00
parent f2c390e940
commit dc4617c576
2 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('champion_skins', function (Blueprint $table) {
$table->renameColumn('raritiy', 'rarity');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('champion_skins', function (Blueprint $table) {
$table->renameColumn('rarity', 'raritiy');
});
}
};

View File

@@ -2,6 +2,7 @@
namespace Database\Seeders; namespace Database\Seeders;
use App\Models\Champion;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
class ChampionSkinSeeder extends Seeder class ChampionSkinSeeder extends Seeder
@@ -11,6 +12,12 @@ class ChampionSkinSeeder extends Seeder
*/ */
public function run(): void 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();
}
} }
} }