Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

JackRobertson's avatar

How to define a blade closing directive in php storm?

I'm using the @hasSection directive in my layout file, however php storm does not recognise it. I've added it to list of existing directives which is working fine, but it still doesnt recognise @endif as it's closing directive... How can I define @endif to be @hasSection's closing directive within php storm?

0 likes
6 replies
ejdelmonico's avatar

Do you also have the Laravel Plugin v0.11 installed?

1 like
JackRobertson's avatar

@ejdelmonico yes that plugin is also installed. All the other blade directives work as expected, I only have an issue with "@hasSection". I have added it to the directives list and it's now being recognised by the editor, however it still does not recognise "@endif" as its closing counterpart.

Added @hasSection to directive list

settings

@endif not being recognised as closing directive

editor

Please or to participate in this conversation.