Skip to content

Debugging Public Output

Use this when a public page renders the wrong HTML, leaks internal state, misses package output, bypasses cache, or serves stale content.

flowchart TD
Request["HTTP request"] --> Site["Resolve site/domain"]
Site --> Language["Resolve language"]
Language --> Page["Resolve page URL"]
Page --> Hydrate["Hydrate page/layout/theme/render data"]
Hydrate --> Hooks["Render components and hooks"]
Hooks --> Safety["Public HTML safety inspection"]
Safety --> Cache{"Cacheable?"}
Cache -->|yes| Store["Store/serve cache"]
Cache -->|no| Bypass["Return uncached response"]

Public Blade receives prepared data. If a Blade view queries the database or lazy-loads a relationship, treat it as a performance and safety bug.

Terminal window
php artisan optimize:clear
php artisan route:list
php artisan list capell

When static HTML cache is installed:

Terminal window
php artisan capell:html-cache:clear
php artisan queue:work

Fetch the page as an anonymous user and search for internal markers:

Terminal window
curl -s https://example.test/ > /tmp/capell-page.html
rg "filament|signed|field_path|data-capell|model_id|permission|editor|authoring" /tmp/capell-page.html

Expected result: no matches for admin/editor/internal markers. Public copy can naturally contain words like “editor” only when it is real content, not authoring state.

SymptomLikely causeCheckFix
Package output missingRender hook/component not registered or unsupported contextRenderHookRegistry, component registry, package providerRegister from frontend provider and test anonymous rendering.
Package route returns page fallbackPath not reserved before frontend fallbackphp artisan route:list and ReservedFrontendPathRegistryReserve exact path or prefix in frontend provider.
Cache bypass header appearsUnsafe HTML inspector found internal outputResponse headers and safety scanRemove authoring/admin state from public output.
Stale page contentQueue/cache invalidation/static cache issueQueue worker, cache driver, page cache directoryRegister invalidation dependency and run workers.
Public Blade triggers queriesView reads models/relationships directlyLaravel query log or tests with lazy loading preventionHydrate data in controller/action/view component before render.
CSS missing in package outputTailwind source/import not registeredTailwindAssetsRegistry::toReport()Register package source/import and rebuild assets.
it('does not expose authoring markers to anonymous visitors', function (): void {
$response = $this->get('/example-page');
$response->assertOk();
expect($response->getContent())
->not->toContain('data-capell-editor')
->not->toContain('field_path')
->not->toContain('filament')
->not->toContain('signed');
});
it('renders the package hook with public data only', function (): void {
app(RenderHookRegistry::class)->register(RenderHookLocation::BodyStart, fn (): string => '<p>Public notice</p>');
$this->get('/example-page')
->assertOk()
->assertSee('Public notice', false);
});
it('renders public page from hydrated data', function (): void {
Model::preventLazyLoading();
$this->get('/example-page')->assertOk();
});