I'm happy to share that we have released our latest package, https://github.com/spatie/laravel-blade-comments. This package can add comments to your rendered HTML output.

At the top of the HTML document, we'll also add some extra information about the topmost Blade view and the request.

namespace Spatie\BladeComments\Commenters\BladeCommenters; class AnonymousBladeComponentCommenter implements BladeCommenter { public function pattern(): string { return '/(##BEGIN-COMPONENT-CLASS##@component\(\'Illuminate\\\\View\\\\AnonymousComponent\',\s*\'([^\']+)\'[^\)]*\)[\s\S]*?@endComponentClass##END-COMPONENT-CLASS##)/'; } public function replacement(): string { return '

If the comment function returns a string, it will be injected at the top of the HTML document.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners