fix: Update Champion image URLs from CDN Cdragon to RAW

- Refactored the Champion model to use new image URLs for different attributes.
- Updated blade templates to fetch champion images with correct URLs.
This commit is contained in:
Rico van Zelst
2024-04-14 13:46:53 +02:00
parent 3478d5330b
commit 01b3e35e87
3 changed files with 32 additions and 46 deletions

View File

@@ -99,26 +99,18 @@ class Champion extends Model
return $this->hasMany(Streamer::class, 'champion_id', 'champion_id');
}
public function getChampionImageAttribute($centered = true): string
public function getChampionImageAttribute(): string
{
$url = 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/splash-art';
return $centered ? $url.'/centered' : $url;
return 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-splashes/' . $this->champion_id . '/' . $this->champion_id . '000.jpg';
}
public function getChampionImageLoadingAttribute(): string
{
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/portrait';
}
public function getChampionImageTileAttribute(): string
{
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/tile';
return 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-tiles/' . $this->champion_id . '/' . $this->champion_id . '000.jpg';
}
public function getChampionSquareImageAttribute(): string
{
return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/square';
return 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-icons/' . $this->champion_id . '.png';
}
public function getChampionAbilityIconQAttribute(): string