mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
feat: cloudflare purge
This commit is contained in:
@@ -15,6 +15,7 @@ class SkinChromaSeeder extends Seeder
|
||||
{
|
||||
$championDataUrl = 'https://cdn.merakianalytics.com/riot/lol/resources/latest/en-US/champions.json';
|
||||
$championData = json_decode(file_get_contents($championDataUrl), true);
|
||||
$changeCount = 0;
|
||||
|
||||
foreach ($championData as $champion) {
|
||||
foreach ($champion['skins'] as $skin) {
|
||||
@@ -50,12 +51,17 @@ class SkinChromaSeeder extends Seeder
|
||||
if ($chromaExists && $this->hasAttributesChanged($chromaExists, $chromaAttributes)) {
|
||||
Log::info('Updating chroma: ' . $chromaId);
|
||||
$chromaExists->update($chromaAttributes);
|
||||
$changeCount++;
|
||||
} elseif (!$chromaExists) {
|
||||
Log::info('Creating chroma: ' . $chromaId);
|
||||
SkinChroma::create($chromaAttributes);
|
||||
$changeCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($changeCount > 0) {
|
||||
$this->call('cloudflare:purge');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user