Blade is Laravel's built-in templating engine. Unlike many PHP templating tools, it doesn't restrict you from using plain PHP in your views, but it provides clean shorthand for the most common tasks. Blade files use the .blade.php extension and are compiled into plain PHP and cached, so there's no runtime overhead.
Displaying data (auto-escaped, XSS-safe):
<h1>{{ $title }}</h1>
<p>{{ $user->name ?? 'Guest' }}</p>
Unescaped output (use with caution, only for trusted HTML):
{!! $rawHtml !!}
Control structures:
@if ($user->isAdmin())
<p>Welcome, admin.</p>
@elseif ($user->isEditor())
<p>Welcome, editor.</p>
@else
<p>Welcome, guest.</p>
@endif
@foreach ($posts as $post)
<li>{{ $post->title }}</li>
@endforeach
@forelse ($posts as $post)
<li>{{ $post->title }}</li>
@empty
<p>No posts yet.</p>
@endforelse
Blade also provides @auth, @guest, @csrf (for forms), @method('PUT') (to spoof HTTP verbs in forms), and @error('field') for displaying validation errors inline next to a form field.