From 2bdce2fbc064e31f6ce98870b3d2aa8386e6e5ba Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Fri, 18 Feb 2022 10:19:32 -0500 Subject: [PATCH 1/2] Update InertiaStatamic.php --- src/InertiaStatamic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InertiaStatamic.php b/src/InertiaStatamic.php index 9d2d82c..82f73d7 100644 --- a/src/InertiaStatamic.php +++ b/src/InertiaStatamic.php @@ -25,7 +25,7 @@ public function handle(Request $request, Closure $next) { $page = app(FrontendController::class)->index($request); - if ($page->augmentedValue('template') === 'app' && ($page instanceof Page || $page instanceof Entry)) { + if ($page->template() === 'app' && ($page instanceof Page || $page instanceof Entry)) { return Inertia::render( $this->buildComponentPath($page), $this->buildProps($page) From d2442b59dab2f8b8b94d4c2ffa5163185778b8a4 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Fri, 18 Feb 2022 10:28:23 -0500 Subject: [PATCH 2/2] check instance first --- src/InertiaStatamic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InertiaStatamic.php b/src/InertiaStatamic.php index 82f73d7..45b0a76 100644 --- a/src/InertiaStatamic.php +++ b/src/InertiaStatamic.php @@ -25,7 +25,7 @@ public function handle(Request $request, Closure $next) { $page = app(FrontendController::class)->index($request); - if ($page->template() === 'app' && ($page instanceof Page || $page instanceof Entry)) { + if (($page instanceof Page || $page instanceof Entry) && $page->template() === 'app') { return Inertia::render( $this->buildComponentPath($page), $this->buildProps($page)