Fix error with deadline for entries
This commit is contained in:
Matt Young 2024-09-14 09:59:40 -05:00
parent 091307b20f
commit 401197b683
1 changed files with 4 additions and 1 deletions

View File

@ -7,6 +7,7 @@ use App\Exceptions\ManageEntryException;
use App\Models\Audition; use App\Models\Audition;
use App\Models\AuditLogEntry; use App\Models\AuditLogEntry;
use App\Models\Entry; use App\Models\Entry;
use Carbon\Carbon;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@ -38,7 +39,9 @@ class EntryController extends Controller
'audition_id' => ['required', 'exists:auditions,id'], 'audition_id' => ['required', 'exists:auditions,id'],
]); ]);
$audition = Audition::find($validData['audition_id']); $audition = Audition::find($validData['audition_id']);
if ($audition->entry_deadline < now()) { $currentDate = Carbon::now('America/Chicago');
$currentDate = $currentDate->format('Y-m-d');
if ($audition->entry_deadline < $currentDate) {
return redirect()->route('entries.index')->with('error', 'The entry deadline for that audition has passed'); return redirect()->route('entries.index')->with('error', 'The entry deadline for that audition has passed');
} }