Skip to content

Commit 8b38391

Browse files
authored
fix: redirect to latest visible election (#311)
1 parent 3d2417b commit 8b38391

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/Http/Controllers/RedirectToElectionController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ class RedirectToElectionController extends Controller
1212
public function __invoke(?Election $election = null): RedirectResponse
1313
{
1414
$election ??= Election::query()
15+
->withoutGlobalScopes()
1516
->where('is_visible', true)
17+
->latest('date')
1618
->first();
1719

1820
abort_unless($election, 404);

0 commit comments

Comments
 (0)