โ Laravel learning pathLaravel ยท Module 4 of 10
Blade templates
Build views with Blade's clean syntax.
๐ Key ideas
- Views live in resources/views/*.blade.php.
- Print with {{ $name }} (escaped).
- Directives: @if, @foreach, @auth, @csrf.
- Layouts: @extends("layouts.app") with @section and @yield, or components <x-layout>.
- 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