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

Commit

Permalink
Merge pull request #8 from edalzell/fix/404-error
Browse files Browse the repository at this point in the history
Use actual lookup so we don’t 404
  • Loading branch information
hotmeteor committed Oct 19, 2022
2 parents a7b1334 + d0ce60d commit 9faec9c
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 9faec9c

Please sign in to comment.