diff --git a/src/BladeService.php b/src/BladeService.php
index 643d884c..1ff5c8d1 100644
--- a/src/BladeService.php
+++ b/src/BladeService.php
@@ -6,6 +6,7 @@
use Illuminate\Support\Str;
use Illuminate\View\Compilers\BladeCompiler;
use Illuminate\View\Compilers\ComponentTagCompiler;
+use Illuminate\View\Factory;
use Livewire\Blaze\Compiler\DirectiveCompiler;
use Livewire\Blaze\Support\LaravelRegex;
use ReflectionClass;
@@ -16,6 +17,7 @@ class BladeService
public function __construct(
public BladeCompiler $compiler,
+ protected Factory $view,
) {
$this->tagCompiler = new ComponentTagCompiler(blade: $compiler);
}
@@ -194,87 +196,29 @@ public function viewCacheInvalidationHook(callable $callback): void
*/
public function componentNameToPath($name): string
{
- $viewFinder = app('view')->getFinder();
+ $finder = $this->view->getFinder();
- $reflection = new \ReflectionClass($this->compiler);
- $pathsProperty = $reflection->getProperty('anonymousComponentPaths');
- $paths = $pathsProperty->getValue($this->compiler) ?? [];
-
- if (str_contains($name, '::')) {
- [$namespace, $componentName] = explode('::', $name, 2);
- $componentPath = str_replace('.', '/', $componentName);
-
- foreach ($paths as $pathData) {
- if (isset($pathData['prefix']) && $pathData['prefix'] === $namespace) {
- $basePath = rtrim($pathData['path'], '/');
-
- $fullPath = $basePath.'/'.$componentPath.'.blade.php';
- if (file_exists($fullPath)) {
- return $fullPath;
- }
-
- $indexPath = $basePath.'/'.$componentPath.'/index.blade.php';
- if (file_exists($indexPath)) {
- return $indexPath;
- }
-
- $lastSegment = basename($componentPath);
- $sameNamePath = $basePath.'/'.$componentPath.'/'.$lastSegment.'.blade.php';
- if (file_exists($sameNamePath)) {
- return $sameNamePath;
- }
- }
- }
-
- try {
- $viewName = str_replace('::', '::components.', $name);
- return $viewFinder->find($viewName);
- } catch (\Exception $e) {
- try {
- return $viewFinder->find(str_replace('::', '::components.', $name).'.index');
- } catch (\Exception $e2) {
- return '';
- }
- }
+ if (! is_null($guess = $this->guessAnonymousComponentUsingNamespaces($this->view, $name)) ||
+ ! is_null($guess = $this->guessAnonymousComponentUsingPaths($this->view, $name))) {
+ return $finder->find($guess);
}
- $componentPath = str_replace('.', '/', $name);
-
- foreach ($paths as $pathData) {
- if (! isset($pathData['prefix']) || $pathData['prefix'] === null) {
- $registeredPath = $pathData['path'] ?? $pathData;
-
- if (is_string($registeredPath)) {
- $basePath = rtrim($registeredPath, '/');
+ return '';
+ }
- $fullPath = $basePath.'/'.$componentPath.'.blade.php';
- if (file_exists($fullPath)) {
- return $fullPath;
- }
+ protected function guessAnonymousComponentUsingNamespaces(Factory $viewFactory, string $component): string|null
+ {
+ $reflection = new \ReflectionClass($this->tagCompiler);
+ $method = $reflection->getMethod('guessAnonymousComponentUsingNamespaces');
- $indexPath = $basePath.'/'.$componentPath.'/index.blade.php';
- if (file_exists($indexPath)) {
- return $indexPath;
- }
+ return $method->invoke($this->tagCompiler, $viewFactory, $component);
+ }
- $lastSegment = basename($componentPath);
- $sameNamePath = $basePath.'/'.$componentPath.'/'.$lastSegment.'.blade.php';
- if (file_exists($sameNamePath)) {
- return $sameNamePath;
- }
- }
- }
- }
+ protected function guessAnonymousComponentUsingPaths(Factory $viewFactory, string $component): string|null
+ {
+ $reflection = new \ReflectionClass($this->tagCompiler);
+ $method = $reflection->getMethod('guessAnonymousComponentUsingPaths');
- try {
- return $viewFinder->find("components.{$name}");
- } catch (\Exception $e) {
- try {
- return $viewFinder->find("components.{$name}.index");
- } catch (\Exception $e2) {
- return '';
- }
- }
+ return $method->invoke($this->tagCompiler, $viewFactory, $component);
}
-
}
diff --git a/tests/BladeServiceTest.php b/tests/BladeServiceTest.php
new file mode 100644
index 00000000..cdc5642a
--- /dev/null
+++ b/tests/BladeServiceTest.php
@@ -0,0 +1,21 @@
+componentNameToPath($prefix . $name))->toBe($path);
+})
+->with([
+ 'default path' => [fn () => null, 'dummy.'],
+ 'custom path' => [fn () => Blade::anonymousComponentPath(fixture_path('views/components/dummy')), ''],
+ 'custom path with prefix' => [fn () => Blade::anonymousComponentPath(fixture_path('views/components/dummy'), 'dummy'), 'dummy::'],
+ 'custom namespace' => [fn () => Blade::anonymousComponentNamespace('components.dummy', 'dummy'), 'dummy::'],
+])
+->with([
+ 'exact file' => ['foo', fixture_path('views/components/dummy/foo.blade.php')],
+ 'index file' => ['bar', fixture_path('views/components/dummy/bar/index.blade.php')],
+ 'directory name' => ['baz', fixture_path('views/components/dummy/baz/baz.blade.php')],
+]);
\ No newline at end of file
diff --git a/tests/Compiler/CompilerTest.php b/tests/Compiler/CompilerTest.php
index 80b7c276..f049af58 100644
--- a/tests/Compiler/CompilerTest.php
+++ b/tests/Compiler/CompilerTest.php
@@ -10,7 +10,7 @@
$node = app(Parser::class)->parse($input)[0];
$compiled = app(Compiler::class)->compile($node);
- $path = fixture_path('components/input.blade.php');
+ $path = fixture_path('views/components/input.blade.php');
$hash = Utils::hash($path);
expect($compiled->render())->toEqualCollapsingWhitespace(join('', [
@@ -38,7 +38,7 @@
$node = app(Parser::class)->parse($input)[0];
$compiled = app(Compiler::class)->compile($node);
- $path = fixture_path('components/card.blade.php');
+ $path = fixture_path('views/components/card.blade.php');
$hash = Utils::hash($path);
expect($compiled->render())->toEqualCollapsingWhitespace(join('', [
diff --git a/tests/Compiler/WrapperTest.php b/tests/Compiler/WrapperTest.php
index 4ad22991..e806c649 100644
--- a/tests/Compiler/WrapperTest.php
+++ b/tests/Compiler/WrapperTest.php
@@ -6,7 +6,7 @@
use Livewire\Blaze\BladeService;
test('wraps component templates into function definitions', function () {
- $path = fixture_path('components/input.blade.php');
+ $path = fixture_path('views/components/input.blade.php');
$source = file_get_contents($path);
$hash = Utils::hash($path);
@@ -31,7 +31,7 @@
});
test('compiles aware props', function () {
- $path = fixture_path('components/input-aware.blade.php');
+ $path = fixture_path('views/components/input-aware.blade.php');
$source = file_get_contents($path);
$hash = Utils::hash($path);
diff --git a/tests/Folder/FoldableTest.php b/tests/Folder/FoldableTest.php
index 1ab8e1fc..9d848702 100644
--- a/tests/Folder/FoldableTest.php
+++ b/tests/Folder/FoldableTest.php
@@ -11,7 +11,7 @@
$input = '';
$node = app(Parser::class)->parse($input)[0];
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/input.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/input.blade.php')), app(BladeRenderer::class), app(BladeService::class));
expect($foldable->fold())->toEqualCollapsingWhitespace(
''
@@ -35,7 +35,7 @@
;
$node = app(Parser::class)->parse($input)[0];
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/card.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/card.blade.php')), app(BladeRenderer::class), app(BladeService::class));
expect($foldable->fold())->toEqualCollapsingWhitespace(<<<'HTML'
@@ -53,7 +53,7 @@
$input = '
';
$node = app(Parser::class)->parse($input)[0];
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/input.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/input.blade.php')), app(BladeRenderer::class), app(BladeService::class));
expect($foldable->fold())->toEqualCollapsingWhitespace(
'
'
@@ -64,7 +64,7 @@
$input = '
';
$node = app(Parser::class)->parse($input)[0];
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/input.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/input.blade.php')), app(BladeRenderer::class), app(BladeService::class));
expect($foldable->fold())->toEqualCollapsingWhitespace(
'
'
@@ -75,7 +75,7 @@
$input = '
';
$node = app(Parser::class)->parse($input)[0];
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/input-aware.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/input-aware.blade.php')), app(BladeRenderer::class), app(BladeService::class));
$node->setParentsAttributes([
'type' => new Attribute(
@@ -106,7 +106,7 @@
),
]);
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/input-aware.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/input-aware.blade.php')), app(BladeRenderer::class), app(BladeService::class));
expect($foldable->fold())->toEqualCollapsingWhitespace(
'
'
@@ -117,7 +117,7 @@
$input = '
';
$node = app(Parser::class)->parse($input)[0];
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/input.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/input.blade.php')), app(BladeRenderer::class), app(BladeService::class));
expect($foldable->fold())->toEqualCollapsingWhitespace(
sprintf('
', join('', [
@@ -134,7 +134,7 @@
$node = app(Parser::class)->parse($input)[0];
$node->hasAwareDescendants = true;
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/card.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/card.blade.php')), app(BladeRenderer::class), app(BladeService::class));
expect($foldable->fold())->toEqualCollapsingWhitespace(join('', [
'pushData([\'name\' => \'John\']); $__env->pushConsumableComponentData([\'name\' => \'John\']); ?>',
@@ -149,7 +149,7 @@
$node = app(Parser::class)->parse($input)[0];
$node->hasAwareDescendants = true;
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/card.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/card.blade.php')), app(BladeRenderer::class), app(BladeService::class));
expect($foldable->fold())->toEqualCollapsingWhitespace(join('', [
'pushData([\'name\' => $name]); $__env->pushConsumableComponentData([\'name\' => $name]); ?>',
@@ -164,7 +164,7 @@
$node = app(Parser::class)->parse($input)[0];
$node->hasAwareDescendants = true;
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/card.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/card.blade.php')), app(BladeRenderer::class), app(BladeService::class));
expect($foldable->fold())->toEqualCollapsingWhitespace(join('', [
'pushData([\'name\' => \'Mr. \'.e($name)]); $__env->pushConsumableComponentData([\'name\' => \'Mr. \'.e($name)]); ?>',
diff --git a/tests/Folder/FolderTest.php b/tests/Folder/FolderTest.php
index 6c951faa..b7f74f06 100644
--- a/tests/Folder/FolderTest.php
+++ b/tests/Folder/FolderTest.php
@@ -210,7 +210,7 @@
test('folds components with no blaze directive if enabled in config', function () {
$input = '
';
- app(Config::class)->add(fixture_path('components/foldable'), fold: true);
+ app(Config::class)->add(fixture_path('views/components/foldable'), fold: true);
$node = app(Parser::class)->parse($input)[0];
$folded = app(Folder::class)->fold($node);
@@ -221,7 +221,7 @@
test('folds components with blaze directive even if disabled in config', function () {
$input = '
';
- app(Config::class)->add(fixture_path('components/foldable'), fold: false);
+ app(Config::class)->add(fixture_path('views/components/foldable'), fold: false);
$node = app(Parser::class)->parse($input)[0];
$folded = app(Folder::class)->fold($node);
diff --git a/tests/Folder/UnblazeTest.php b/tests/Folder/UnblazeTest.php
index 07d54133..508548e4 100644
--- a/tests/Folder/UnblazeTest.php
+++ b/tests/Folder/UnblazeTest.php
@@ -10,7 +10,7 @@
$input = '
';
$node = app(Parser::class)->parse($input)[0];
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/input-unblaze.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/input-unblaze.blade.php')), app(BladeRenderer::class), app(BladeService::class));
expect($foldable->fold())->toEqualCollapsingWhitespace(
sprintf('
', join('', [
@@ -26,7 +26,7 @@
$input = '
';
$node = app(Parser::class)->parse($input)[0];
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/nested-input-unblaze.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/nested-input-unblaze.blade.php')), app(BladeRenderer::class), app(BladeService::class));
expect($foldable->fold())->toEqualCollapsingWhitespace(
sprintf('
', join('', [
@@ -42,7 +42,7 @@
$input = '
';
$node = app(Parser::class)->parse($input)[0];
- $foldable = new Foldable($node, new ComponentSource(fixture_path('components/foldable/input-unblaze.blade.php')), app(BladeRenderer::class), app(BladeService::class));
+ $foldable = new Foldable($node, new ComponentSource(fixture_path('views/components/foldable/input-unblaze.blade.php')), app(BladeRenderer::class), app(BladeService::class));
expect($foldable->fold())->toEqualCollapsingWhitespace(
sprintf('
', join('', [
diff --git a/tests/Memoizer/MemoizerTest.php b/tests/Memoizer/MemoizerTest.php
index 3ceca116..8c8fb739 100644
--- a/tests/Memoizer/MemoizerTest.php
+++ b/tests/Memoizer/MemoizerTest.php
@@ -13,7 +13,7 @@
$node = app(Parser::class)->parse($input)[0];
$memoized = app(Memoizer::class)->memoize($node);
- $path = fixture_path('components/memoizable/avatar.blade.php');
+ $path = fixture_path('views/components/memoizable/avatar.blade.php');
$hash = Utils::hash($path);
expect($memoized->render())->toEqualCollapsingWhitespace(join('', [
@@ -58,7 +58,7 @@
test('memoizes components without blaze directive if enabled in config', function () {
$input = '
';
- app(Config::class)->add(fixture_path('components/memoizable'), memo: true);
+ app(Config::class)->add(fixture_path('views/components/memoizable'), memo: true);
$node = app(Parser::class)->parse($input)[0];
$memoized = app(Memoizer::class)->memoize($node);
diff --git a/tests/TestCase.php b/tests/TestCase.php
index c2cf49a8..ce7a360a 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -30,7 +30,7 @@ protected function getEnvironmentSetUp($app)
]);
$app['blade.compiler']->anonymousComponentPath(
- __DIR__.'/fixtures/components',
+ __DIR__.'/fixtures/views/components',
);
// Isolate compiled view paths for parallel testing to prevent
diff --git a/tests/fixtures/components/card.blade.php b/tests/fixtures/views/components/card.blade.php
similarity index 100%
rename from tests/fixtures/components/card.blade.php
rename to tests/fixtures/views/components/card.blade.php
diff --git a/tests/fixtures/views/components/dummy/bar/index.blade.php b/tests/fixtures/views/components/dummy/bar/index.blade.php
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/fixtures/views/components/dummy/baz/baz.blade.php b/tests/fixtures/views/components/dummy/baz/baz.blade.php
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/fixtures/views/components/dummy/foo.blade.php b/tests/fixtures/views/components/dummy/foo.blade.php
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/fixtures/components/foldable/card-unsafe-slot.blade.php b/tests/fixtures/views/components/foldable/card-unsafe-slot.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/card-unsafe-slot.blade.php
rename to tests/fixtures/views/components/foldable/card-unsafe-slot.blade.php
diff --git a/tests/fixtures/components/foldable/card-unsafe.blade.php b/tests/fixtures/views/components/foldable/card-unsafe.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/card-unsafe.blade.php
rename to tests/fixtures/views/components/foldable/card-unsafe.blade.php
diff --git a/tests/fixtures/components/foldable/card.blade.php b/tests/fixtures/views/components/foldable/card.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/card.blade.php
rename to tests/fixtures/views/components/foldable/card.blade.php
diff --git a/tests/fixtures/components/foldable/input-aware.blade.php b/tests/fixtures/views/components/foldable/input-aware.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/input-aware.blade.php
rename to tests/fixtures/views/components/foldable/input-aware.blade.php
diff --git a/tests/fixtures/components/foldable/input-no-blaze.blade.php b/tests/fixtures/views/components/foldable/input-no-blaze.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/input-no-blaze.blade.php
rename to tests/fixtures/views/components/foldable/input-no-blaze.blade.php
diff --git a/tests/fixtures/components/foldable/input-safe.blade.php b/tests/fixtures/views/components/foldable/input-safe.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/input-safe.blade.php
rename to tests/fixtures/views/components/foldable/input-safe.blade.php
diff --git a/tests/fixtures/components/foldable/input-unblaze.blade.php b/tests/fixtures/views/components/foldable/input-unblaze.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/input-unblaze.blade.php
rename to tests/fixtures/views/components/foldable/input-unblaze.blade.php
diff --git a/tests/fixtures/components/foldable/input-unsafe-attributes.blade.php b/tests/fixtures/views/components/foldable/input-unsafe-attributes.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/input-unsafe-attributes.blade.php
rename to tests/fixtures/views/components/foldable/input-unsafe-attributes.blade.php
diff --git a/tests/fixtures/components/foldable/input-unsafe.blade.php b/tests/fixtures/views/components/foldable/input-unsafe.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/input-unsafe.blade.php
rename to tests/fixtures/views/components/foldable/input-unsafe.blade.php
diff --git a/tests/fixtures/components/foldable/input.blade.php b/tests/fixtures/views/components/foldable/input.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/input.blade.php
rename to tests/fixtures/views/components/foldable/input.blade.php
diff --git a/tests/fixtures/components/foldable/nested-input-unblaze.blade.php b/tests/fixtures/views/components/foldable/nested-input-unblaze.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/nested-input-unblaze.blade.php
rename to tests/fixtures/views/components/foldable/nested-input-unblaze.blade.php
diff --git a/tests/fixtures/components/foldable/unblaze-only-wrapper.blade.php b/tests/fixtures/views/components/foldable/unblaze-only-wrapper.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/unblaze-only-wrapper.blade.php
rename to tests/fixtures/views/components/foldable/unblaze-only-wrapper.blade.php
diff --git a/tests/fixtures/components/foldable/unblaze-only.blade.php b/tests/fixtures/views/components/foldable/unblaze-only.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/unblaze-only.blade.php
rename to tests/fixtures/views/components/foldable/unblaze-only.blade.php
diff --git a/tests/fixtures/components/foldable/unblaze-slot-wrapper.blade.php b/tests/fixtures/views/components/foldable/unblaze-slot-wrapper.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/unblaze-slot-wrapper.blade.php
rename to tests/fixtures/views/components/foldable/unblaze-slot-wrapper.blade.php
diff --git a/tests/fixtures/components/foldable/wrapper-nl.blade.php b/tests/fixtures/views/components/foldable/wrapper-nl.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/wrapper-nl.blade.php
rename to tests/fixtures/views/components/foldable/wrapper-nl.blade.php
diff --git a/tests/fixtures/components/foldable/wrapper.blade.php b/tests/fixtures/views/components/foldable/wrapper.blade.php
similarity index 100%
rename from tests/fixtures/components/foldable/wrapper.blade.php
rename to tests/fixtures/views/components/foldable/wrapper.blade.php
diff --git a/tests/fixtures/components/input-aware-no-blaze.blade.php b/tests/fixtures/views/components/input-aware-no-blaze.blade.php
similarity index 100%
rename from tests/fixtures/components/input-aware-no-blaze.blade.php
rename to tests/fixtures/views/components/input-aware-no-blaze.blade.php
diff --git a/tests/fixtures/components/input-aware.blade.php b/tests/fixtures/views/components/input-aware.blade.php
similarity index 100%
rename from tests/fixtures/components/input-aware.blade.php
rename to tests/fixtures/views/components/input-aware.blade.php
diff --git a/tests/fixtures/components/input-no-blaze.blade.php b/tests/fixtures/views/components/input-no-blaze.blade.php
similarity index 100%
rename from tests/fixtures/components/input-no-blaze.blade.php
rename to tests/fixtures/views/components/input-no-blaze.blade.php
diff --git a/tests/fixtures/components/input.blade.php b/tests/fixtures/views/components/input.blade.php
similarity index 100%
rename from tests/fixtures/components/input.blade.php
rename to tests/fixtures/views/components/input.blade.php
diff --git a/tests/fixtures/components/invalid-foldable/auth.blade.php b/tests/fixtures/views/components/invalid-foldable/auth.blade.php
similarity index 100%
rename from tests/fixtures/components/invalid-foldable/auth.blade.php
rename to tests/fixtures/views/components/invalid-foldable/auth.blade.php
diff --git a/tests/fixtures/components/invalid-foldable/csrf.blade.php b/tests/fixtures/views/components/invalid-foldable/csrf.blade.php
similarity index 100%
rename from tests/fixtures/components/invalid-foldable/csrf.blade.php
rename to tests/fixtures/views/components/invalid-foldable/csrf.blade.php
diff --git a/tests/fixtures/components/invalid-foldable/error.blade.php b/tests/fixtures/views/components/invalid-foldable/error.blade.php
similarity index 100%
rename from tests/fixtures/components/invalid-foldable/error.blade.php
rename to tests/fixtures/views/components/invalid-foldable/error.blade.php
diff --git a/tests/fixtures/components/invalid-foldable/errors.blade.php b/tests/fixtures/views/components/invalid-foldable/errors.blade.php
similarity index 100%
rename from tests/fixtures/components/invalid-foldable/errors.blade.php
rename to tests/fixtures/views/components/invalid-foldable/errors.blade.php
diff --git a/tests/fixtures/components/invalid-foldable/old.blade.php b/tests/fixtures/views/components/invalid-foldable/old.blade.php
similarity index 100%
rename from tests/fixtures/components/invalid-foldable/old.blade.php
rename to tests/fixtures/views/components/invalid-foldable/old.blade.php
diff --git a/tests/fixtures/components/invalid-foldable/once.blade.php b/tests/fixtures/views/components/invalid-foldable/once.blade.php
similarity index 100%
rename from tests/fixtures/components/invalid-foldable/once.blade.php
rename to tests/fixtures/views/components/invalid-foldable/once.blade.php
diff --git a/tests/fixtures/components/invalid-foldable/request.blade.php b/tests/fixtures/views/components/invalid-foldable/request.blade.php
similarity index 100%
rename from tests/fixtures/components/invalid-foldable/request.blade.php
rename to tests/fixtures/views/components/invalid-foldable/request.blade.php
diff --git a/tests/fixtures/components/invalid-foldable/session.blade.php b/tests/fixtures/views/components/invalid-foldable/session.blade.php
similarity index 100%
rename from tests/fixtures/components/invalid-foldable/session.blade.php
rename to tests/fixtures/views/components/invalid-foldable/session.blade.php
diff --git a/tests/fixtures/components/memoizable/avatar-no-blaze.blade.php b/tests/fixtures/views/components/memoizable/avatar-no-blaze.blade.php
similarity index 100%
rename from tests/fixtures/components/memoizable/avatar-no-blaze.blade.php
rename to tests/fixtures/views/components/memoizable/avatar-no-blaze.blade.php
diff --git a/tests/fixtures/components/memoizable/avatar.blade.php b/tests/fixtures/views/components/memoizable/avatar.blade.php
similarity index 100%
rename from tests/fixtures/components/memoizable/avatar.blade.php
rename to tests/fixtures/views/components/memoizable/avatar.blade.php