mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 10:10:48 +01:00
feat: refactor code and improve readability
This commit is contained in:
@@ -23,7 +23,7 @@ class ChampionRoles extends Model
|
||||
|
||||
public function getRolesAttribute($value): array
|
||||
{
|
||||
$value = json_decode($value);
|
||||
$value = json_decode((string) $value);
|
||||
|
||||
$roleNames = [
|
||||
'TOP' => 'Toplane',
|
||||
|
||||
@@ -28,11 +28,11 @@ class Streamer extends Model
|
||||
public function getStreamerUrlAttribute(): string
|
||||
{
|
||||
return match ($this->platform) {
|
||||
'Twitch' => "https://www.twitch.tv/{$this->username}",
|
||||
'YouTube' => "https://www.youtube.com/@{$this->username}",
|
||||
'Kick' => "https://kick.com/{$this->username}",
|
||||
'Douyu' => "https://www.douyu.com/{$this->username}",
|
||||
'Huya' => "https://www.huya.com/{$this->username}",
|
||||
'Twitch' => 'https://www.twitch.tv/' . $this->username,
|
||||
'YouTube' => 'https://www.youtube.com/@' . $this->username,
|
||||
'Kick' => 'https://kick.com/' . $this->username,
|
||||
'Douyu' => 'https://www.douyu.com/' . $this->username,
|
||||
'Huya' => 'https://www.huya.com/' . $this->username,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user