'array', ]; public function getResourceTypeAttribute($value): string { $resourceTypes = [ 'BLOOD_WELL' => "Blood", "MANA" => "Mana", "ENERGY" => "Energy", "NONE" => "None", "HEALTH" => "Health", "RAGE" => "Rage", "COURAGE" => "Courage", "SHIELD" => "Shield", "FURY" => "Fury", "FEROCITY" => "Ferocity", "HEAT" => "Heat", "GRIT" => "Grit", "BLOODTHIRST" => "Bloodthirst", "FLOW" => "Flow", "SOUL_UNBOUND" => "Soul Unbound", ]; return $resourceTypes[$value]; } public function getAdaptiveTypeAttribute($value): string { $adaptiveTypes = [ 'ADAPTIVE_DAMAGE' => 'Adaptive', 'MAGIC_DAMAGE' => 'Magical', 'PHYSICAL_DAMAGE' => 'Physical', ]; return $adaptiveTypes[$value]; } public function sluggable(): array { return [ 'slug' => [ 'source' => 'name', ], ]; } public function getRouteKeyName(): string { return 'slug'; } public function skins(): HasMany { return $this->hasMany(ChampionSkin::class, 'champion_id', 'champion_id'); } public function lanes(): HasOne { return $this->hasOne(ChampionRoles::class, 'champion_id', 'champion_id'); } public function getChampionImageAttribute($centered = true): string { $url = 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/splash-art'; return $centered ? $url . '/centered' : $url; } 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'; } public function getChampionSquareImageAttribute(): string { return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/square'; } public function getChampionAbilityIconQAttribute(): string { return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/q'; } public function getChampionAbilityIconWAttribute(): string { return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/w'; } public function getChampionAbilityIconEAttribute(): string { return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/e'; } public function getChampionAbilityIconRAttribute(): string { return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/r'; } public function getChampionAbilityIconPAttribute(): string { return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/p'; } }