1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
laravel-tips/content/tips/you-can-use-at-includewhen-to-include-certain-blade-partials-when-some-condition-is-met-for-instance-when-the-current-user-is-an-admin.md
2022-01-14 19:18:35 +01:00

11 lines
No EOL
601 B
Markdown

---
title: 'You can use @includeWhen to include certain Blade partials when some condition is met. For instance, when the current user is an admin'
tweet_id: '1482036560354676737'
thread_slug: weekly-thread-2022-02
author_username: marcelpociot
images:
- 'https://pbs.twimg.com/media/FI47GaYXMAI7SeA.jpg'
created_at: 2022-01-14T17:07:05+00:00
slug: you-can-use-at-includewhen-to-include-certain-blade-partials-when-some-condition-is-met-for-instance-when-the-current-user-is-an-admin
---
Make use of the built-in "includeWhen" and "includeUnless" directives to get rid of those ugly if conditions.