DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Enhancing Angular Directives: Implementing Permission-Based Conditional Rendering With Else Case
  • CORS Anywhere on Pure NGINX Config
  • Laravel for Beginners: An Overview of the PHP Framework
  • A Step-By-Step Guide: How To Install a Laravel Script

Trending

  • Blue Skies Ahead: An AI Case Study on LLM Use for a Graph Theory Related Application
  • Ethical AI in Agile
  • The Full-Stack Developer's Blind Spot: Why Data Cleansing Shouldn't Be an Afterthought
  • Performing and Managing Incremental Backups Using pg_basebackup in PostgreSQL 17
  1. DZone
  2. Coding
  3. Frameworks
  4. 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.

By 
Adi Sk user avatar
Adi Sk
·
Feb. 04, 19 · Tutorial
Likes (5)
Comment
Save
Tweet
Share
14.6K Views

Join the DZone community and get the full member experience.

Join For Free

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

10 Underused Laravel Blade Directives - @foreach

@each

10 Underused Laravel Blade Directives - @each

@json

10 Underused Laravel Blade Directives - @json

@verbatim

10 Underused Laravel Blade Directives - @verbatim

@isset & @ empty

10 Underused Laravel Blade Directives - @isset & @ empty

@php

10 Underused Laravel Blade Directives - @php

@push & @stack

10 Underused Laravel Blade Directives - @push & @stack

@inject

10 Underused Laravel Blade Directives - @inject

@includeWhen

10 Underused Laravel Blade Directives - @includeWhen

@hasSection

10 Underused Laravel Blade Directives - @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.

  1. LaravelCollections.com
  2. Laravel Blade Documentation
  3. Scotch.io tutorial
  4. Custom Blade directives package

Thanks for reading!

BLADE (software) Laravel Directive (programming)

Published at DZone with permission of Adi Sk. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Enhancing Angular Directives: Implementing Permission-Based Conditional Rendering With Else Case
  • CORS Anywhere on Pure NGINX Config
  • Laravel for Beginners: An Overview of the PHP Framework
  • A Step-By-Step Guide: How To Install a Laravel Script

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: