← Laravel learning path
Laravel · Module 4 of 10

Blade templates

Build views with Blade's clean syntax.

📖 Key ideas

  1. Views live in resources/views/*.blade.php.
  2. Print with {{ $name }} (escaped).
  3. Directives: @if, @foreach, @auth, @csrf.
  4. Layouts: @extends("layouts.app") with @section and @yield, or components <x-layout>.
  5. Components: php artisan make:component Alert.
💡 Real-life example: Blade is a stencil set: one layout traced many times with different words filled in.
BladeLaravel template engine
{{ }}Escaped output
@foreachLoop directive
ComponentReusable Blade view piece