@componentWhen Blade directive #1013
Comments
Just found another issue requesting this: #618 |
Isn't this just wrapping the I understand that there's an existing includeWhen directive, and that is relevant when we decide the name for a new directive. But the existence of includeWhen alone does not justify adding this new directive. If it did, then we would never be able to get rid of any of them since they both are justifying their presence with "there's another one with a similar name already". |
In that case the slot (or in my example the input) won't render at all. To achieve the behavior as I described with a normal
A |
I found a way to do this with the new component classes:
By default it will be wrapped:
To disable it:
But it's not that pretty... |
Just like the
@includeWhen
directive which can be found here in the docs. I'd like to have a@componentWhen
directive. When the boolean is false it will just return the slot.This makes it possible to conditionally wrap slots with Blade components. Example:
input.blade.php
form-group.blade.php
The text was updated successfully, but these errors were encountered: