SummonerIconController handles HTTP requests for the summoner icon catalog with search, filtering, and administrative CRUD operations.
Overview
Located atsource/app/Http/Controllers/SummonerIconController.php, this controller:
- Displays paginated icon catalog (72 icons per page)
- Filters by title, esports team, and release year
- Sorts by icon ID (newest first)
- Implements 1-hour caching with query-specific cache keys
- Provides full CRUD operations for icon management
- Shows individual icon detail pages
Class Definition
Routes
Defined insource/routes/web.php:51-52:
Methods
index()
Displays a filterable, paginated listing of summoner icons.Query Parameters
Filter by icon title (exact match)Example:
?filter[title]=Worlds 2023Filter by esports team abbreviationExample:
?filter[esports_team]=T1Filter by release yearExample:
?filter[release_year]=2023Page number for pagination (72 icons per page)Example:
?page=2Return Value
Rendered
icons.index Blade templateView Data
Paginated collection of summoner icons (72 per page)
Cache Strategy
Icons are cached for 1 hour with a unique cache key per query combination using MD5 hash of serialized query parameters.
icons_{md5_hash_of_query}
Examples:
icons_d41d8cd98f00b204e9800998ecf8427e(no filters)icons_a3c2f1e9b8d7c6a5b4e3d2c1f0e9d8c7(with filters)
Default Sorting
Icons are sorted by
icon_id in descending order (newest icons first). The - prefix indicates descending sort.Usage Examples
show()
Displays a specific icon’s detail page.Parameters
SummonerIcon model instance (automatically resolved via route model binding)
Return Value
Rendered
icons.show Blade templateView Data
Individual summoner icon model
Usage Example
store()
Creates a new summoner icon (administrative function).Validation Rules
Riot Games API icon ID
Icon display title
Year the icon was released
Whether the icon is legacy (limited availability)
CDN URL for the icon image
Team abbreviation (e.g., “T1”, “G2”)
Region code (e.g., “LCK”, “LEC”)
Event name (e.g., “Worlds 2023”)
Icon description text
Return Value
Newly created SummonerIcon model instance
update()
Updates an existing summoner icon.Parameters
Icon to update (resolved via route model binding)
Return Value
Updated SummonerIcon model instance
destroy()
Deletes a summoner icon.Parameters
Icon to delete (resolved via route model binding)
Return Value
Empty JSON response with 200 status code
Spatie Query Builder
This controller uses Spatie Query Builder for filtering:Allowed Filters
title (exact match)
title (exact match)
Column:
titleType: Exact matchExample: ?filter[title]=Worlds matches icons with exactly “Worlds” in the titleesports_team (exact match)
esports_team (exact match)
Column:
esports_teamType: Exact matchExample: ?filter[esports_team]=T1 matches only T1 team iconsrelease_year (exact match)
release_year (exact match)
Column:
release_yearType: Exact match (integer)Example: ?filter[release_year]=2023 matches only 2023 releasesPagination
Number of icons displayed per page
Performance Considerations
Query-Specific Caching
Each unique query combination gets its own cache key
1-Hour Cache
Icons cached for 1 hour per query
Large Pages
72 icons per page reduces number of requests
Indexed Queries
Ensure filterable columns are indexed
Related Documentation
SummonerIcon Model
View the SummonerIcon model API reference
Assets Feature
Learn about the game assets browsing feature
Emote Controller
View the emote controller documentation
Architecture
Understand the MVC architecture