]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/ProtocolController.php
chat bot settings
[alttp.git] / app / Http / Controllers / ProtocolController.php
index c7e3bd2051feb4aef6d179f7878d71bb077402b9..e4f028042212c9bede6d19fa09ccf378b2cce6d8 100644 (file)
@@ -2,9 +2,20 @@
 
 namespace App\Http\Controllers;
 
+use App\Models\Tournament;
 use Illuminate\Http\Request;
 
 class ProtocolController extends Controller
 {
-       //
+
+       public function forTournament(Tournament $tournament) {
+               $this->authorize('viewProtocol', $tournament);
+               $protocol = $tournament
+                       ->protocols()
+                       ->with('user')
+                       ->orderBy('created_at', 'desc')
+                       ->get();
+               return $protocol->values()->toJson();
+       }
+
 }