Blade Templates and Views
Render dynamic HTML with Blade directives, layouts, and components.
What is Blade?
Blade is Laravel' templating engine. Files end in .blade.php and support directives, loops, and layout inheritance. Blade is compiled to plain PHP and cached.
Outputting Variables
Use double curly braces to output a variable. The value is automatically escaped to prevent XSS.
{{-- resources/views/greeting.blade.php --}}
<h1>Hello, {{ $name }}</h1>
<p>You have {{ $messageCount }} messages.</p>All lessons in this course
- Laravel Project Structure
- Defining Routes in Laravel
- Controllers and Actions
- Blade Templates and Views