Skip to content

Commit dcd41ec

Browse files
committed
View: FakeCompiler for Livewire
1 parent a26b1ca commit dcd41ec

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/AffordableMobiles/GServerlessSupportLaravel/View/Compilers/FakeCompiler.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,15 @@ public function getExtensions(): array
184184
{
185185
return ['blade.php'];
186186
}
187+
188+
/**
189+
* Register a path for anonymous blade components.
190+
* This is a no-op at runtime as components are pre-compiled.
191+
*/
192+
public function anonymousComponentPath(string $path, ?string $prefix = null): void
193+
{
194+
// We don't need to do anything here at runtime because the view manifest
195+
// has already mapped all the components during the pre-compilation step.
196+
// This method just needs to exist to satisfy Livewire's service provider.
197+
}
187198
}

src/AffordableMobiles/GServerlessSupportLaravel/View/ViewServiceProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ public function registerGServerlessBladeEngine($resolver): void
158158
throw new \RuntimeException('GServerless FileViewFinder not correctly registered or failed to load manifest.');
159159
});
160160

161+
$this->app->singleton('blade.compiler', static fn ($app) => $app['gserverless.blade.compiler.fake']);
162+
161163
$resolver->register('blade', fn () => new CompilerEngine($this->app['gserverless.blade.compiler.fake']));
162164
}
163165

0 commit comments

Comments
 (0)