]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/RoundController.php
listen to round updates
[alttp.git] / app / Http / Controllers / RoundController.php
index 10e4d14857fd45000863df2fab536583a8404c6e..1488d97bff92e15004407c2bc6493f507761bfcd 100644 (file)
@@ -2,6 +2,8 @@
 
 namespace App\Http\Controllers;
 
+use App\Events\RoundAdded;
+use App\Models\Protocol;
 use App\Models\Round;
 use App\Models\Tournament;
 use Illuminate\Http\Request;
@@ -20,6 +22,14 @@ class RoundController extends Controller
                        'tournament_id' => $validatedData['tournament_id'],
                ]);
 
+               Protocol::roundAdded(
+                       $tournament,
+                       $round,
+                       $request->user(),
+               );
+
+               RoundAdded::dispatch($round);
+
                return $round->toJson();
        }