Skip to content

Commit

Permalink
[5.x] Check site requested when using global route binding on api rou…
Browse files Browse the repository at this point in the history
…tes (#10894)
  • Loading branch information
ryanmitchell authored Oct 3, 2024
1 parent d3f41a8 commit 69e78eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,9 @@ protected function bindGlobalSets()
? GlobalSet::findByHandle($handle)
: GlobalSet::all()->first(fn ($set) => $set->$field($handle));

$site = Site::default()->handle();
if (! $site = ($this->isApiRoute($route) ? request()->input('site') : false)) {
$site = Site::default()->handle();
}

throw_unless(
$globalSet = $global?->in($site),
Expand Down

0 comments on commit 69e78eb

Please sign in to comment.