mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 10:10:48 +01:00
feat(champion-skin): Improve skin image URL handling
- Refactored the `getSkinImageAttribute` method in ChampionSkin model to accept a boolean parameter for uncentered images. - Updated references to `getSkinImageAttribute` in ChampionSkinController and blade files to include the new parameter for uncentered images.
This commit is contained in:
@@ -72,9 +72,13 @@ class ChampionSkin extends Model
|
||||
return $this->hasMany(SkinChroma::class, 'full_skin_id', 'full_skin_id');
|
||||
}
|
||||
|
||||
public function getSkinImageAttribute(): string
|
||||
public function getSkinImageAttribute(bool $uncentered = false): string
|
||||
{
|
||||
return 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-splashes/'.$this->champion_id.'/'.$this->full_skin_id.'.jpg';
|
||||
$baseUrl = 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-splashes/';
|
||||
$imagePath = $uncentered ? 'uncentered/' : '';
|
||||
$imageUrl = $baseUrl . $imagePath . $this->champion_id . '/' . $this->full_skin_id . '.jpg';
|
||||
|
||||
return $imageUrl;
|
||||
}
|
||||
|
||||
public function getSkinImageLoadingAttribute(): string
|
||||
|
||||
Reference in New Issue
Block a user