]> git.localhorst.tv Git - alttp.git/blob - app/Http/Controllers/TournamentController.php
c5bd40d84febb55ef3cb5fd3c632ee6c9f6e52b9
[alttp.git] / app / Http / Controllers / TournamentController.php
1 <?php
2
3 namespace App\Http\Controllers;
4
5 use App\Models\Tournament;
6 use Illuminate\Http\Request;
7
8 class TournamentController extends Controller
9 {
10
11         public function single(Request $request, $id) {
12                 $tournament = Tournament::with(
13                         'rounds',
14                         'rounds.results',
15                         'participants',
16                         'participants.user',
17                 )->findOrFail($id);
18                 $this->authorize('view', $tournament);
19                 return $tournament->toJson();
20         }
21
22 }