Lesson list · Lesson 4 of 5
The Basics · Lesson 4 of 5
Blade Templates
Show data in your pages safely, with loops and conditions.
1 min 0 comments
Blade lets you mix HTML with data. Double curly braces print a value and escape it, so text typed by users cannot inject scripts.
<h1>{{ $post->title }}</h1>
@foreach ($post->comments as $comment)
<p>{{ $comment->body }}</p>
@endforeachLayouts
Put the parts every page shares (the header and footer) in one layout, and let each page fill in only its own content.
Discussion
Log in to join the conversation. Log in
Rizky A. on the class page
Is this class enough to start building my own project?
Codesakura Author
Yes. After the last chapter you can build a simple CRUD app on your own.
Bagas P. in lesson What Is Laravel?
Clear and to the point. Looking forward to the next lesson!