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

Related

  • Data-Driven Enterprise Apps: How Laravel Simplifies Analytics Integration
  • Laravel + Next.js Integration Guide (Real-World Setup, 2025)
  • How Laravel Developers Handle Database Migrations Without Downtime
  • Enhancing Angular Directives: Implementing Permission-Based Conditional Rendering With Else Case

Trending

  • Swift Concurrency Part 4: Actors, Executors, and Reentrancy
  • Lease Coordination Under Serializable Isolation in CockroachDB
  • Stop Guessing, Start Seeing: A Five -Layer Framework for Monitoring Distributed Systems
  • Designing Effective Meetings in Tech: From Time Wasters to Strategic Tools
  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.9K 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

  • Data-Driven Enterprise Apps: How Laravel Simplifies Analytics Integration
  • Laravel + Next.js Integration Guide (Real-World Setup, 2025)
  • How Laravel Developers Handle Database Migrations Without Downtime
  • Enhancing Angular Directives: Implementing Permission-Based Conditional Rendering With Else Case

Partner Resources

×

Comments

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

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

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 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook