Blade is Laravel's template engine. Blade files end with .blade.php and live in resources/views.
Showing data
{{ $name }}— prints a value escaped, which protects against XSS attacks{!! $html !!}— prints raw HTML; use only for content you trust
Conditions and loops
@if,@elseif,@else,@endif@foreach ($posts as $post) ... @endforeach@forelse ... @empty ... @endforelse— handles an empty list
Layouts
Write the page frame once in layouts/app.blade.php with @yield('content'). Each page uses @extends('layouts.app') and fills @section('content').
Other useful directives
@include('partials.nav')— insert another view@csrf— adds the security token every POST form needs@auth ... @endauth— show content only to logged-in users
Example
Example — Layout and child page
PHP
{{-- resources/views/layouts/app.blade.php --}}
<html>
<body>
<h1>My Blog</h1>
@yield('content')
</body>
</html>
{{-- resources/views/posts/index.blade.php --}}
@extends('layouts.app')
@section('content')
<ul>
@forelse ($posts as $post)
<li>{{ $post }}</li>
@empty
<li>No posts yet.</li>
@endforelse
</ul>
@endsection
The page shows the "My Blog" heading from the layout, then a list of posts — or "No posts yet." if the array is empty.