mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
style: laravel pint lint
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\Champion;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ChampionSeeder extends Seeder
|
||||
@@ -13,7 +13,7 @@ class ChampionSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$championDataUrl = "http://cdn.merakianalytics.com/riot/lol/resources/latest/en-US/champions.json";
|
||||
$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) {
|
||||
@@ -39,10 +39,10 @@ class ChampionSeeder extends Seeder
|
||||
// Check if the champion already exists and if any attributes have changed, if so update the champion. If the champion doesn't exist, create it.
|
||||
// This is to prevent the champion data from being updated every time the seeder is run. As I'll probably run this on a cron job.
|
||||
if ($championExists && $this->hasAttributesChanged($championExists, $championAttributes)) {
|
||||
Log::info('Champion ' . $champion['name'] . ' has changed, updating...');
|
||||
Log::info('Champion '.$champion['name'].' has changed, updating...');
|
||||
$championExists->update($championAttributes);
|
||||
} elseif (!$championExists) {
|
||||
Log::info('New champion detected! Creating ' . $champion['name'] . '...');
|
||||
} elseif (! $championExists) {
|
||||
Log::info('New champion detected! Creating '.$champion['name'].'...');
|
||||
Champion::create($championAttributes);
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,7 @@ class ChampionSeeder extends Seeder
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user