style: laravel pint lint

This commit is contained in:
Rico van Zelst
2023-11-01 14:09:25 +01:00
parent 69c072a003
commit 9ced9a83f3
10 changed files with 47 additions and 45 deletions

View File

@@ -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;
}
}