game-village-politics-backend/app/Websocket/Controllers/RankingController.php

21 lines
562 B
PHP
Raw Permalink Normal View History

<?php
namespace App\Websocket\Controllers;
use App\Actions\Ranking;
use App\Websocket\GameController;
/** ranking.index {world_id, kind: players|villages|attack|defense, page?}: without a page, the user's own. */
class RankingController extends GameController
{
public function index()
{
return $this->play(fn () => app(Ranking::class)->list(
auth()->user(),
(int) request('world_id'),
(string) (request('kind') ?: 'players'),
request('page') ? (int) request('page') : null,
));
}
}