Hey folks! I hope you're all doing well.
Today, I want to share something simple but important. It can really save your ass when working with Blade templates in Laravel.
If you ever need to use @something
in your Blade templates, make sure to wrap it with the @verbatim
directive. Otherwise, if Laravel releases a new Blade directive in the future that uses the same name, your code could unexpectedly break.
Here’s a real example from a project I’m currently working on. Laravel recently released a new directive called @context
(on 2025.07.10), and it caused issues for us because we had a JSON-LD script block like this:
<script type="application/ld+json">
{
"@context": "https://schema.org",
// ...
}
</script>
Since we didn't wrap it with @verbatim
, Blade tried to parse @context
as a directive, which broke the page.
To prevent this, you should always write it like this:
@verbatim
<script type="application/ld+json">
{
"@context": "https://schema.org",
// ...
}
</script>
@endverbatim
Stay safe out there!