3 namespace App\Http\Controllers;
5 use App\Models\Tournament;
6 use Illuminate\Auth\Access\AuthorizationException;
7 use Illuminate\Http\Request;
9 class TournamentController extends Controller
12 public function single(Request $request, $id) {
13 $tournament = Tournament::with(
19 $this->authorize('view', $tournament);
20 foreach ($tournament->rounds as $round) {
22 $this->authorize('seeResults', $round);
23 } catch (AuthorizationException) {
24 $round->hideResults();
27 return $tournament->toJson();