feat: some fixes to the ui, imlemented user and guest user, ans used the dahboard

This commit is contained in:
2026-08-16 16:24:25 +02:00
parent 4639baa9ae
commit 50e9fbd0b0
37 changed files with 1657 additions and 194 deletions
+18
View File
@@ -30,6 +30,8 @@ class RoundController extends Controller
->lockForUpdate()
->findOrFail($room->id);
$this->ensureRoomIsOpen($lockedRoom);
Vote::query()
->where('room_id', $lockedRoom->id)
->where('round', $lockedRoom->current_round)
@@ -37,6 +39,7 @@ class RoundController extends Controller
$lockedRoom->update([
'revealed_at' => null,
'last_activity_at' => now(),
'state_version' => $lockedRoom->state_version + 1,
]);
});
@@ -62,6 +65,8 @@ class RoundController extends Controller
->lockForUpdate()
->findOrFail($room->id);
$this->ensureRoomIsOpen($lockedRoom);
if ($lockedRoom->revealed_at !== null) {
throw ValidationException::withMessages([
'room' => 'Die Karten sind bereits aufgedeckt.',
@@ -70,6 +75,7 @@ class RoundController extends Controller
$lockedRoom->update([
'revealed_at' => now(),
'last_activity_at' => now(),
'state_version' => $lockedRoom->state_version + 1,
]);
});
@@ -95,6 +101,8 @@ class RoundController extends Controller
->lockForUpdate()
->findOrFail($room->id);
$this->ensureRoomIsOpen($lockedRoom);
if ($lockedRoom->revealed_at === null) {
throw ValidationException::withMessages([
'room' => 'Die aktuelle Runde muss zuerst aufgedeckt werden.',
@@ -104,10 +112,20 @@ class RoundController extends Controller
$lockedRoom->update([
'current_round' => $lockedRoom->current_round + 1,
'revealed_at' => null,
'last_activity_at' => now(),
'state_version' => $lockedRoom->state_version + 1,
]);
});
return back();
}
private function ensureRoomIsOpen(Room $room): void
{
if ($room->isClosed()) {
throw ValidationException::withMessages([
'room' => 'Dieser Raum ist geschlossen.',
]);
}
}
}