Imagine we have blade component component-a and we want to pass some attribute to it on some condition ( well, if condition did not met, we want to pass nothing ).
Currently when using condition directives ( @if, @isset , ...) it will make error : syntax error, unexpected 'endif' (T_ENDIF), expecting end of file
<!--component-a.blade.php-->
<div {!! $attributes !!}></div>
<!-- main view file -->
<x-component-a @if(true) property @endif />
I see you're using 7.0.2, can you upgrade to the very latest version? Numerous fixes have been made since.
Thanks for feedback. Upgraded to 7.2.1 and same results appear.
Unfortunately we don't seem to support this syntax. Please try:
@if(true)
<x-component-a property />
@else
<x-component-a />
@endif