--- /dev/null
+<?php
+
+namespace App\Console\Commands;
+
+use App\Events\RoundChanged;
+use App\Models\Protocol;
+use App\Models\Round;
+use Illuminate\Console\Command;
+
+class LockRound extends Command
+{
+ /**
+ * The name and signature of the console command.
+ *
+ * @var string
+ */
+ protected $signature = 'round:lock {round}';
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = 'Lock the round';
+
+ /**
+ * Execute the console command.
+ *
+ * @return int
+ */
+ public function handle()
+ {
+ $round = Round::findOrFail($this->argument('round'));
+
+ if ($round->locked) {
+ $this->line('already locked');
+ return 0;
+ }
+
+ $round->locked = true;
+ $round->save();
+
+ Protocol::roundLocked(
+ $round->tournament,
+ $round,
+ );
+
+ RoundChanged::dispatch($round);
+
+ return 0;
+ }
+}