10 Underused Laravel Blade Directives
10 Underused Laravel Blade Directives
Learn how to work with the Laravel Blade template engine and make your code cleaner and easier to write.
Join the DZone community and get the full member experience.
Join For FreeJumpstart your Angular applications with Indigo.Design, a unified platform for visual design, UX prototyping, code generation, and app development.
Laravel Blade is the template engine that’s built into the framework. It makes working with HTML a breeze. I have been working with Laravel for more than a year, but never realized some of Blade’s features. I want to share with you 10 underused blade directives that will clean up your code and save some time in the process. Let’s get going.
Check out LaravelCollections.com - an ever growing collection of great Laravel resources
@forelse
@each
@json
@verbatim
@isset & @ empty
@php
@push & @stack
@inject
@includeWhen
@hasSection
Conclusion
I hope these tips help you write better Blade views. If you have a tip, do share with us. I have linked to a few resources, which will help you take you Laravel skill to the next level.
- LaravelCollections.com
- Laravel Blade Documentation
- Scotch.io tutorial
- Custom Blade directives package
Thanks for reading!
Take a look at an Indigo.Design sample application to learn more about how apps are created with design to code software.
Published at DZone with permission of Adi Sk . See the original article here.
Opinions expressed by DZone contributors are their own.
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}
{{ parent.urlSource.name }}