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

Commit

Permalink
use actual lookup so we don’t 404
Browse files Browse the repository at this point in the history
  • Loading branch information
edalzell committed Oct 19, 2022
1 parent a7b1334 commit d0ce60d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/InertiaStatamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down

0 comments on commit d0ce60d

Please sign in to comment.