feat: refactor code and improve readability

This commit is contained in:
Rico van Zelst
2025-03-04 12:50:19 +01:00
parent efc263e257
commit 68d18311b4
8 changed files with 25 additions and 34 deletions

View File

@@ -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',

View File

@@ -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,
};
}