Ease the process of assigning prelim auditions to rooms.

This commit is contained in:
Matt Young 2025-09-22 19:27:18 -05:00
parent 81b10220d6
commit 2418873af0
2 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,8 @@ class RoomController extends Controller
{ {
$rooms = Room::with('auditions.entries', 'entries')->orderBy('name')->get(); $rooms = Room::with('auditions.entries', 'entries')->orderBy('name')->get();
// Check if room id 0 exists, if not, create it and assign all unassigned auditions to it
if (! $rooms->contains('id', 0)) { if (! $rooms->contains('id', 0)) {
$unassignedRoom = Room::create([ $unassignedRoom = Room::create([
'id' => 0, 'id' => 0,

View File

@ -38,7 +38,7 @@
<x-form.select name="room_id"> <x-form.select name="room_id">
<x-slot:label>Room</x-slot:label> <x-slot:label>Room</x-slot:label>
@foreach($rooms as $room) @foreach($rooms as $room)
<option value="{{ $room->id }}" @if($prelim && $prelim->room_id == $room->id) SELECTED @endif>{{ $room->name }}</option> <option value="{{ $room->id }}" @if($prelim && $prelim->room_id == $room->id) SELECTED @endif>{{ $room->name }} - {{ $room->description }}</option>
@endforeach @endforeach
</x-form.select> </x-form.select>
@error('room_id') @error('room_id')