Blade is the templating engine included with the Laravel framework. Unlike some PHP templating engines, Blade does not restrict the use of plain PHP code in templates. All Blade templates are compiled into plain PHP and cached until modified, so Blade adds essentially zero overhead to an application.
{{ $name }}
{{-- This comment will not be rendered --}}
Blade's {{ }} syntax automatically escapes output through PHP's htmlspecialchars function to help prevent XSS attacks. Unescaped output can be printed with {!! $html !!} when needed.
@if ($count > 0)
There are {{ $count }} items.
@else
No items found.
@endif
@foreach ($posts as $post)
{{ $post->title }}
@endforeach
Blade supports template inheritance through @extends and @section, letting a child view fill in sections of a shared parent layout. Blade components, defined as classes with their own view files, provide a more reusable alternative for building UI elements that accept data and slots.
Applications can register their own Blade directives, extending the templating language with custom syntax that compiles down to plain PHP when the view is rendered.
By: Tomas Silny
Edited: 2026-08-13 03:31:19