I have installed some Visual Studio Code extensions to handle Laravel Blade Code like
But they are not helping me to format Laravel Blade Code [blade.php files]. I mean they are not auto indenting the code as I expected. But I have seen blade code online which are well indented in visual studio Code IDE.
Example :
Visual Studio Code Environment For Laravel
Is their any specific configuration or technique which I can use to make these extensions work or there is some other way?








First go to "Visual Studio Code" Settings and search for the option "files.associations" If that option is not available in your settings. Please update your Visual Studio Code to latest version.
In the settings overwrite panel past the following snippet
It'll associate .blade.php and .tpl file extensions for html type
Save it and your are good to go. Happy formatting :)
Update: There are still some issues in formatting html with blade code, the formatter tend to bring blade code in a single line while executing format command. However, if your code grow that's won't be a problem. Moreover, you can easily manage those by putting a line comment in between your blade blocks. And commenting in code is always a good thing.
Update: Seems updated version adds an option to enable blade formatting in the user settings. To use that,
Please make sure you are using the latest version and "Laravel Blade Snippets" Extension installed.
Then Ctrl+Shift+P : type User settings : Enter
That's it.