Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions src/Providers/CpServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use Inertia\Inertia;
use Statamic\CP\Utilities\UtilityRepository;
use Statamic\Extensions\Translation\Loader;
use Statamic\Extensions\Translation\Translator;
Expand All @@ -21,8 +20,6 @@ class CpServiceProvider extends ServiceProvider
{
public function boot()
{
Inertia::setRootView('statamic::layout');

View::composer('statamic::*', function ($view) {
$view->with('user', User::current());
});
Expand Down
19 changes: 19 additions & 0 deletions tests/Feature/InertiaRootViewTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Tests\Feature;

use Illuminate\Http\Request;
use Inertia\Inertia;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;

class InertiaRootViewTest extends TestCase
{
#[Test]
public function it_does_not_set_the_inertia_root_view_globally()
{
$response = Inertia::render('Test')->toResponse(Request::create('/'));

$this->assertEquals('app', $response->getOriginalContent()->name());
}
}
1 change: 1 addition & 0 deletions tests/__fixtures__/views/app.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div id="app" data-page="{{ json_encode($page) }}"></div>
Loading