skip to Main Content

VS Code automatically does not define .blade.php files. That is, I should manually switch the mode through the "Select Language Mode" button in the lower right corner or through hot keys (Ctrl + K + M) so that the file is identified as .blade.php and then the code is highlighted.

enter image description here

Otherwise, the file is identified simply as .php.

I have several extensions, including "Laravel Blade Snippets" and "Laravel Blade Spacer":

enter image description here

What needs to be done so that VS Code automatically recognizes .blade.php files?

Maybe it’s about the Settings (JSON)?
enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    In file settings.json (to open it press Ctrl + Shift + P and type "Settings (JSON)") I added the line "*.blade.php": "blade" in file association part.

    As a result (in my case):

    "files.associations": {
        "*.php": "php",
        "*.blade.php": "blade"
    }
    

    Now files with extension blade.php are recognized and treated as Blade code.


Please signup or login to give your own answer.
Back To Top
Search