mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 10:10:48 +01:00
- Refactored the ChampionController, ChampionSkinController, HomeController, SaleController, SummonerEmoteController, and SummonerIconController to use arrow functions for cache callbacks. - Updated the view data passing in the ChampionController, ChampionSkinController, HomeController, PostsController, SaleController, SummonerEmoteController, and SummonerIconController to use associative arrays instead of compact(). - Removed unused imports from web.php.
24 lines
710 B
PHP
24 lines
710 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\ChampionSkin;
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
class HomeController extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
$upcomingSkins = Cache::remember('upcomingSkins_home', 60 * 4, static fn() => ChampionSkin::where('availability', 'Upcoming')
|
|
->orderBy('release_date', 'desc')->get());
|
|
|
|
$latestSkins = Cache::remember('latestSkins_home', 60 * 4, static fn() => ChampionSkin::where('availability', 'Available')
|
|
->orderBy('release_date', 'desc')->take(9)->get());
|
|
|
|
return view('home', [
|
|
'latestSkins' => $latestSkins,
|
|
'upcomingSkins' => $upcomingSkins,
|
|
]);
|
|
}
|
|
}
|