]> git.localhorst.tv Git - alttp.git/blob - app/Http/Controllers/ProtocolController.php
protocol frontend
[alttp.git] / app / Http / Controllers / ProtocolController.php
1 <?php
2
3 namespace App\Http\Controllers;
4
5 use App\Models\Tournament;
6 use Illuminate\Http\Request;
7
8 class ProtocolController extends Controller
9 {
10
11         public function forTournament(Tournament $tournament) {
12                 $this->authorize('viewProtocol', $tournament);
13                 $protocol = $tournament
14                         ->protocols()
15                         ->with('user')
16                         ->orderBy('created_at', 'desc')
17                         ->get();
18                 return $protocol->values()->toJson();
19         }
20
21 }