On the Laravel News site they've shared a list of five useful Blade directives that you may not have known about. Blade is the templating language included with the Laravel framework by default.
We’re going to look at five Laravel Blade directives you can use to simplify your templates, and learn about some convenient directives that make solving specific problems a cinch! If you’re new to the framework, these tips will help you discover the excellent features of Blade, Laravel’s templating engine.
The five on their list provide functionality to:
- Check if the user is authenticated
- Check if the user is a guest
- Include the first view if it exists or includes the second if it doesn’t
- Include a view based on a condition
- Include a view if it exists
Each one comes with example code showing it in use and a bit of explanation behind its use.