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();
+ }
+
}