Skip to content
This repository was archived by the owner on Jan 12, 2023. It is now read-only.

Commit 9faec9c

Browse files
authored
Merge pull request #8 from edalzell/fix/404-error
Use actual lookup so we don’t 404
2 parents a7b1334 + d0ce60d commit 9faec9c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/InertiaStatamic.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
use Inertia\Inertia;
1111
use JsonSerializable;
1212
use Statamic\Entries\Entry;
13+
use Statamic\Facades\Data;
1314
use Statamic\Fields\Value;
14-
use Statamic\Http\Controllers\FrontendController;
1515
use Statamic\Structures\Page;
1616

1717
class InertiaStatamic
@@ -23,7 +23,7 @@ class InertiaStatamic
2323
*/
2424
public function handle(Request $request, Closure $next)
2525
{
26-
$page = app(FrontendController::class)->index($request);
26+
$page = Data::findByRequestUrl($request->url());
2727

2828
if (($page instanceof Page || $page instanceof Entry) && $page->template() === 'app') {
2929
return Inertia::render(

0 commit comments

Comments
 (0)