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

Use actual lookup so we don’t 404 #8

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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