]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/TournamentController.php
basic result display
[alttp.git] / app / Http / Controllers / TournamentController.php
index edf6d120f7403ad198c3332bf11db712d12be89c..c5bd40d84febb55ef3cb5fd3c632ee6c9f6e52b9 100644 (file)
@@ -2,9 +2,21 @@
 
 namespace App\Http\Controllers;
 
+use App\Models\Tournament;
 use Illuminate\Http\Request;
 
 class TournamentController extends Controller
 {
-       //
+
+       public function single(Request $request, $id) {
+               $tournament = Tournament::with(
+                       'rounds',
+                       'rounds.results',
+                       'participants',
+                       'participants.user',
+               )->findOrFail($id);
+               $this->authorize('view', $tournament);
+               return $tournament->toJson();
+       }
+
 }