diff --git a/app/Models/Champion.php b/app/Models/Champion.php index 1711e33..2a79dca 100644 --- a/app/Models/Champion.php +++ b/app/Models/Champion.php @@ -29,9 +29,12 @@ class Champion extends Model 'release_patch', ]; - protected $casts = [ - 'roles' => 'array', - ]; + protected function casts(): array + { + return [ + 'roles' => 'array', + ]; + } public function getResourceTypeAttribute($value): string { diff --git a/app/Models/ChampionRoles.php b/app/Models/ChampionRoles.php index db2bef9..33626a0 100644 --- a/app/Models/ChampionRoles.php +++ b/app/Models/ChampionRoles.php @@ -16,9 +16,12 @@ class ChampionRoles extends Model 'roles', ]; - protected $casts = [ - 'roles' => 'array', - ]; + protected function casts(): array + { + return [ + 'roles' => 'array', + ]; + } public function champion(): BelongsTo { diff --git a/app/Models/ChampionSkin.php b/app/Models/ChampionSkin.php index b0b263e..5cd2867 100644 --- a/app/Models/ChampionSkin.php +++ b/app/Models/ChampionSkin.php @@ -34,11 +34,14 @@ class ChampionSkin extends Model 'splash_artist', ]; - protected $casts = [ - 'associated_skinline' => 'array', - 'voice_actor' => 'array', - 'splash_artist' => 'array', - ]; + protected function casts(): array + { + return [ + 'associated_skinline' => 'array', + 'voice_actor' => 'array', + 'splash_artist' => 'array', + ]; + } public function sluggable(): array { diff --git a/app/Models/ContactSubmission.php b/app/Models/ContactSubmission.php index 8f4fa4c..28a00a9 100644 --- a/app/Models/ContactSubmission.php +++ b/app/Models/ContactSubmission.php @@ -17,7 +17,10 @@ class ContactSubmission extends Model 'message', ]; - protected $casts = [ - 'category' => ContactCategory::class, - ]; + protected function casts(): array + { + return [ + 'category' => ContactCategory::class, + ]; + } } diff --git a/app/Models/SkinChroma.php b/app/Models/SkinChroma.php index 62c9d34..50bebcf 100644 --- a/app/Models/SkinChroma.php +++ b/app/Models/SkinChroma.php @@ -20,9 +20,12 @@ class SkinChroma extends Model 'chroma_image', ]; - protected $casts = [ - 'chroma_colors' => 'array', - ]; + protected function casts(): array + { + return [ + 'chroma_colors' => 'array', + ]; + } public function sluggable(): array { diff --git a/app/Models/SummonerIcon.php b/app/Models/SummonerIcon.php index 9ef0731..65fe381 100644 --- a/app/Models/SummonerIcon.php +++ b/app/Models/SummonerIcon.php @@ -22,9 +22,12 @@ class SummonerIcon extends Model 'esports_event', ]; - protected $casts = [ - 'legacy' => 'boolean', - ]; + protected function casts(): array + { + return [ + 'legacy' => 'boolean', + ]; + } public function sluggable(): array { diff --git a/app/Models/User.php b/app/Models/User.php index f04ee44..97d72dc 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -37,12 +37,15 @@ class User extends Authenticatable ]; /** - * The attributes that should be cast. + * Get the attributes that should be cast. * - * @var array + * @return array */ - protected $casts = [ - 'email_verified_at' => 'datetime', - 'password' => 'hashed', - ]; + protected function casts(): array + { + return [ + 'email_verified_at' => 'datetime', + 'password' => 'hashed', + ]; + } }