If you do this you get an error:
@if($foo)@if($bar)test@endif@endif
And if you do this, you get test >
this appears to be getting a lot of search traffic so I figured I'd add an update to share how I'm handling this these days. Basically, it's a little more code but it ends up being stupid simple and very clean:
@if($foo)
Test
@elseif($bar)
Test2
@else
Test3
@endif
The moral of the story is when you're working with blade, don't try to cram a lot of conditionals within elements. Rather, have the result of the conditional contain the element. It's clean, easy to read, and with only a few more characters spent.