mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
feat: champion list
This commit is contained in:
@@ -6,6 +6,7 @@ use Cviebrock\EloquentSluggable\Sluggable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
|
||||
class Champion extends Model
|
||||
{
|
||||
@@ -46,11 +47,19 @@ class Champion extends Model
|
||||
return $this->hasMany(ChampionSkin::class);
|
||||
}
|
||||
|
||||
public function getChampionImageAttribute(): string
|
||||
public function lanes(): HasOne
|
||||
{
|
||||
return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/splash-art';
|
||||
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';
|
||||
|
||||
Reference in New Issue
Block a user