-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Feature Description
I am not sure if that's in the scope of this plugin but it's rather annoying and a reason not to use Blade custom ifs right now.
With
Blade::if('CustomIf', static fn(string $input): bool => If::customIf($input));This works great:
@CustomIf('input')
@endCustomIfbut PHPStorm doesn't understand this:
@CustomIf('input')
@else
@endCustomIfMissing opening directive
Directive is not closed
So there is no correct formatting and it shows errors where there are none.
Laravel does register @elseCustomIf but that's just an else if block not a working else block.
Open issues in the JetBrains tracker:
https://youtrack.jetbrains.com/projects/WI/issues/WI-42988/Indentation-and-end-start-tag-support-for-blade-Custom-If-Statements
https://youtrack.jetbrains.com/issue/WI-52830/PHPStorm-doesnt-recognize-Blade-custom-directives-companion
Laravel documentation:
https://laravel.com/docs/12.x/blade#custom-if-statements
Thanks!