Blade Template Engine Support in PhpStorm 8 EAP
Support for Blade templates includes highlighting, completion, navigation, find usages, inspections, folding, custom directives, and more.
In this blog post we’ll overview all the Blade-related features.
Support for Blade templates is enabled by default for *.blade.php files, additional file types can be configured in Settings | File Types | Blade.
The first benefit to take advantage of is highlighting of Blade syntax in template files:
Code completion for Blade includes completion for all directives (including custom directives defined in Settings / Preferences | PHP | Blade; more details below in this blog post):
If @for or @foreach directives are used, variable introduction will be offered with autocomplete inside the construct:
Sections defined with a @section directive can be easily collapsed and expanded (block between @section and closing directive is affected by this action):
To make sure that a section opened with a @section directive is closed with one of the corresponding directives, there is an inspection checking that the section is closed:
Blade-specific navigation features include links to templates in @extends and @include directives (use Ctrl+Click / Cmd-Click or Go To Declaration with Ctrl+B / Cmd-B):
Find usages for Blade templates is supported as well: just invoke it on the file name or a symbol in the code (from the context menu or with Alt+F7) to see all the templates usages across your codebase. Note that it currently works only inside other templates, not from views.
And finally, if you would like to customize pre-defined Blade directives, or maybe define your own custom directives for Blade templates, you can easily do so in Settings / Preferences | PHP | Blade:
Develop with pleasure!
-JetBrains PhpStorm Team
Subscribe to Blog updates
Thanks, we've got you!
PhpStorm 2023.2 Beta
In this build, we’ve added new inspections for PHP assertions and revised the integration with third-party quality tools.
PhpStorm 2023.2 EAP #6
This build brings improvements for generating PHPDocs, support for Laravel Pint, a single point of access to all PHP framework plugins, and much more!
AI Features in PhpStorm: PhpStorm 2023.2 EAP #5
The next EAP build for PhpStorm 2023.2 is now available, and it’s an exciting one! It is the first build to include features leveraging the enormous potential of generative AI and large language models (LLMs). Our Early Access Program (EAP) allows you to try new features from the upcoming PhpStor…
PhpStorm 2023.2 EAP #4
This build includes a bunch of usability improvements, such as abilities to pin Run configurations and sort files by modification time in the Project view. The EAP allows you to try new features from the upcoming PhpStorm version, 2023.2. EAP builds are free to use and you can install them side b…