Skip to main content
The ChampionSkin model represents a skin for a League of Legends champion, including pricing, rarity, visual features, and associated metadata. Source: source/app/Models/ChampionSkin.php

Properties

Database Columns

id
integer
required
Auto-incrementing primary key
champion_id
integer
required
Foreign key linking to the champion this skin belongs toDatabase: integer, foreign key to champions.champion_idCascade: Deletes when parent champion is deletedMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:14,33
full_skin_id
integer
required
Combined champion and skin ID (e.g., champion_id=103, skin_id=8 → 103008)Database: unsignedBigInteger, unique indexPurpose: Used as foreign key for skin chromas relationshipMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:15
skin_id
integer
required
Skin’s unique identifier within the champion (e.g., 0 for base skin, 1+ for other skins)Database: integerMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:16
skin_name
string
required
Display name of the skin (e.g., “K/DA ALL OUT”, “Spirit Blossom”)Database: stringMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:17
lore
string
required
Skin’s backstory and lore textDatabase: longTextMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:18
availability
string
required
Availability status (e.g., “Available”, “Legacy”, “Limited”)Database: stringMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:19
loot_eligible
boolean
required
Whether the skin can be obtained through loot/hextech craftingDatabase: booleanMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:20
rp_price
integer
required
Skin price in Riot PointsDatabase: bigIntegerMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:21
rarity
string
required
Skin rarity tier (e.g., “Epic”, “Legendary”, “Ultimate”)Database: string (note: original migration has typo “raritiy”)Accessor: Converts null or “NoRarity” to “Common”Migration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:22Model: source/app/Models/ChampionSkin.php:51-54
release_date
string
required
Skin’s release dateDatabase: stringMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:23
associated_skinline
array
required
Array of associated skin line/theme names (e.g., [“K/DA”, “Prestige”])Database: jsonCasted to: array - automatically serialized/deserializedMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:24Model: source/app/Models/ChampionSkin.php:84
new_effects
boolean
required
Whether the skin has new visual effectsDatabase: booleanMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:25
new_animations
boolean
required
Whether the skin has new animationsDatabase: booleanMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:26
new_recall
boolean
required
Whether the skin has a new recall animationDatabase: booleanMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:27
new_voice
boolean
required
Whether the skin has new voice processing/filterDatabase: booleanMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:28
new_quotes
boolean
required
Whether the skin has new voice lines/quotesDatabase: booleanMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:29
voice_actor
array
required
Array of voice actor names for this skinDatabase: jsonCasted to: array - automatically serialized/deserializedMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:30Model: source/app/Models/ChampionSkin.php:85
splash_artist
array
required
Array of splash art artist namesDatabase: jsonCasted to: array - automatically serialized/deserializedMigration: source/database/migrations/2023_10_26_175822_create_champion_skins_table.php:31Model: source/app/Models/ChampionSkin.php:86
slug
string
URL-friendly slug generated from skin name (used for routing)Database: string, unique index, nullableAuto-generated: Uses Sluggable trait to generate from skin_name fieldMigration: source/database/migrations/2023_11_01_140156_add_slug_to_champion_skins.php:12Model: source/app/Models/ChampionSkin.php:37-49
created_at
timestamp
Record creation timestamp
updated_at
timestamp
Record last update timestamp

Relationships

champion()

Returns the champion that owns this skin. Type: BelongsTo Related Model: Champion Foreign Key: champion_id Source: source/app/Models/ChampionSkin.php:56-59
$skin->champion; // Champion model

chromas()

Returns all chromas (color variants) for this skin. Type: HasMany Related Model: SkinChroma Foreign Key: full_skin_id Source: source/app/Models/ChampionSkin.php:61-64
$skin->chromas; // Collection of SkinChroma models

Accessors & Methods

getRarityAttribute($value)

Mutator that converts null or “NoRarity” values to “Common”. Source: source/app/Models/ChampionSkin.php:51-54 Returns: string
$skin->rarity; // Returns "Common" if value is null or "NoRarity"

getSkinImageAttribute($uncentered = false)

Returns the skin’s splash art image URL. Source: source/app/Models/ChampionSkin.php:66-69 Parameters:
  • $uncentered (bool): Whether to return uncentered splash art
Returns: string - Image URL
$skin->skin_image; // Centered splash
$skin->getSkinImageAttribute(true); // Uncentered splash

getSkinImageLoadingAttribute()

Returns the skin’s loading screen portrait image URL from Community Dragon. Source: source/app/Models/ChampionSkin.php:71-74 Returns: string - Loading screen image URL
$skin->skin_image_loading;
// Returns: https://cdn.communitydragon.org/latest/champion/{champion_id}/portrait/skin/{skin_id}

getSkinImageTileAttribute()

Returns the skin’s tile image URL from Community Dragon. Source: source/app/Models/ChampionSkin.php:76-79 Returns: string - Tile image URL
$skin->skin_image_tile;
// Returns: https://cdn.communitydragon.org/latest/champion/{champion_id}/tile/skin/{skin_id}

getRouteKeyName()

Specifies that routes should use the slug field instead of id. Source: source/app/Models/ChampionSkin.php:46-49 Returns: string - “slug”

Traits

HasFactory

Enables model factory support for testing and seeding. Source: source/app/Models/ChampionSkin.php:13

Sluggable

Automatically generates URL-friendly slugs from the skin name. Source: source/app/Models/ChampionSkin.php:14, 37-44 Configuration:
public function sluggable(): array
{
    return [
        'slug' => [
            'source' => 'skin_name',
        ],
    ];
}

Fillable Attributes

The following attributes are mass-assignable: Source: source/app/Models/ChampionSkin.php:16-35
  • champion_id
  • full_skin_id
  • skin_id
  • skin_name
  • lore
  • availability
  • loot_eligible
  • rp_price
  • rarity
  • release_date
  • associated_skinline
  • new_effects
  • new_animations
  • new_recall
  • new_voice
  • new_quotes
  • voice_actor
  • splash_artist

Usage Example

use App\Models\ChampionSkin;

// Find skin by slug
$skin = ChampionSkin::where('slug', 'kda-all-out-ahri')->first();

// Access properties
echo $skin->skin_name; // "K/DA ALL OUT Ahri"
echo $skin->rp_price; // 1350
echo $skin->rarity; // "Epic"
echo $skin->availability; // "Available"

// Check features
if ($skin->new_effects) {
    echo "This skin has new visual effects";
}

// Access relationships
$champion = $skin->champion; // Parent champion
$chromas = $skin->chromas; // Available chromas

// Get images
$splash = $skin->skin_image;
$loading = $skin->skin_image_loading;
$tile = $skin->skin_image_tile;

// Access array fields
$skinlines = $skin->associated_skinline; // ["K/DA", "ALL OUT"]
$artists = $skin->splash_artist; // ["Artist Name"]

Build docs developers (and LLMs) love