diff --git a/src/InertiaStatamic.php b/src/InertiaStatamic.php index 45b0a76..7769d38 100644 --- a/src/InertiaStatamic.php +++ b/src/InertiaStatamic.php @@ -10,8 +10,8 @@ use Inertia\Inertia; use JsonSerializable; use Statamic\Entries\Entry; +use Statamic\Facades\Data; use Statamic\Fields\Value; -use Statamic\Http\Controllers\FrontendController; use Statamic\Structures\Page; class InertiaStatamic @@ -23,7 +23,7 @@ class InertiaStatamic */ public function handle(Request $request, Closure $next) { - $page = app(FrontendController::class)->index($request); + $page = Data::findByRequestUrl($request->url()); if (($page instanceof Page || $page instanceof Entry) && $page->template() === 'app') { return Inertia::render(