1
0
forked from metin2/web

Localized ranking and modified controllers to read data from cache tables.

This commit is contained in:
2024-12-31 20:24:15 +02:00
parent 744e55e385
commit 103d21b5ef
17 changed files with 753 additions and 261 deletions

View File

@ -0,0 +1,24 @@
<?php
namespace App\View\Composers;
use App\Models\Game\Highscore\GuildHighscoreCache;
use App\Models\Game\Highscore\HighscoreCache;
use Illuminate\View\View;
class HighscoreComposer
{
/**
* Bind data to the view.
*/
public function compose(View $view): void
{
// Fetch the top highscore
$topHighscore = HighscoreCache::orderBy('id')->take(10)->get();
$view->with('topHighscore', $topHighscore);
// Fetch the top guild highscore
$topGuildHighscore = GuildHighscoreCache::orderBy('id')->take(10)->get();
$view->with('topGuildHighscore', $topGuildHighscore);
}
}