X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FHttp%2FControllers%2FProtocolController.php;h=e4f028042212c9bede6d19fa09ccf378b2cce6d8;hb=c30ac282dde3d746d6a7762ee18c70b4416500b5;hp=c7e3bd2051feb4aef6d179f7878d71bb077402b9;hpb=4388278823ac8a791641ac1d65fc675e9543b8e8;p=alttp.git diff --git a/app/Http/Controllers/ProtocolController.php b/app/Http/Controllers/ProtocolController.php index c7e3bd2..e4f0280 100644 --- a/app/Http/Controllers/ProtocolController.php +++ b/app/Http/Controllers/ProtocolController.php @@ -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(); + } + }