SummonerIcon model represents a summoner profile icon in League of Legends, including metadata about esports teams, events, and availability.
Source: source/app/Models/SummonerIcon.php
Properties
Database Columns
Auto-incrementing primary key
Riot Games icon identifierDatabase:
integerMigration: source/database/migrations/2023_11_15_105425_create_summoner_icons_table.php:13Icon title or nameDatabase:
string, nullableMigration: source/database/migrations/2023_11_15_105425_create_summoner_icons_table.php:14Icon description or context (e.g., how it was obtained)Database:
string, nullableMigration: source/database/migrations/2023_11_15_105425_create_summoner_icons_table.php:15Year the icon was releasedDatabase:
integer, nullableMigration: source/database/migrations/2023_11_15_105425_create_summoner_icons_table.php:16Whether the icon is legacy (no longer obtainable)Database:
booleanCasted to: booleanMigration: source/database/migrations/2023_11_15_105425_create_summoner_icons_table.php:17Model: source/app/Models/SummonerIcon.php:49Icon image URL or pathDatabase:
stringMigration: source/database/migrations/2023_11_15_105425_create_summoner_icons_table.php:18Associated esports team name (for team-specific icons)Database:
string, nullableMigration: source/database/migrations/2023_11_15_105425_create_summoner_icons_table.php:19Associated esports region (e.g., “LCK”, “LCS”, “LEC”)Database:
string, nullableMigration: source/database/migrations/2023_11_15_105425_create_summoner_icons_table.php:20Associated esports event (e.g., “Worlds 2023”, “MSI 2024”)Database:
string, nullableMigration: source/database/migrations/2023_11_15_105425_create_summoner_icons_table.php:21URL-friendly slug generated from title and sqidDatabase:
string, unique indexAuto-generated: Uses Sluggable trait combining title and sqid fieldsMigration: source/database/migrations/2023_11_15_105425_create_summoner_icons_table.php:22Model: source/app/Models/SummonerIcon.php:25-32Record creation timestamp
Record last update timestamp
Relationships
This model does not have any defined relationships.Accessors & Methods
getSqidAttribute()
Generates a unique, URL-friendly short ID from the icon_id using Sqids library. Source:source/app/Models/SummonerIcon.php:34-39
Returns: string - 5+ character encoded ID
Purpose: Used as part of the slug generation to ensure uniqueness when icons have similar titles
getRouteKeyName()
Specifies that routes should use theslug field instead of id.
Source: source/app/Models/SummonerIcon.php:41-44
Returns: string - “slug”
Traits
Sluggable
Automatically generates URL-friendly slugs from both the title and sqid. Source:source/app/Models/SummonerIcon.php:11, 25-32
Configuration:
Fillable Attributes
The following attributes are mass-assignable: Source:source/app/Models/SummonerIcon.php:13-23
icon_idtitledescriptionrelease_yearlegacyimageesports_teamesports_regionesports_event
Casts
The model automatically casts the following attributes: Source:source/app/Models/SummonerIcon.php:46-50
legacy→boolean
Usage Example
Notes
- The
sqidaccessor creates a unique short identifier that’s incorporated into the slug for uniqueness - Esports-related fields (
esports_team,esports_region,esports_event) are nullable and only populated for team/event-specific icons - The
Sluggabletrait uses bothtitleandsqidas sources to prevent slug collisions