We all know how text editors are very important to us when we code, for everyone who is getting started with Laravel.
Below, are my list of the Top 10 extensions I recommend for all Laravel/PHP developers, which will help you expand your productivity.
1. Laravel Artisan
We all use the VS Code terminal to run artisan commands and that is great but using the Laravel Artisan Extension you can run the artisan commands from within VS Code directly.
Some of the main features are:
- Make files (Controllers, Migrations, Models, etc)
- Run Custom Commands
- Manage the database
- Clear Caches
- Generate Keys
- View all routes
- Start/stop a local PHP server for test purposes
2. Laravel Blade Snippets
Laravel Blade Snippets extensions add syntax highlight support
Some of the features are
- Blade syntax highlight
- Blade snippets
- Emmet works in blade template
- Blade formatting
After that is done, there is some other stuff to be done for the extension to work properly. Go to
Settings and add this to your
"emmet.triggerExpansionOnTab": true, // enable tab to expanse emmet tags
"blade.format.enable": true, // if you would like to enable blade format
For more information on how to use the Laravel Blade Snippets make sure to your check here documentation here.
3. Laravel Blade Spacer
Laravel blade spacer helps to automatically add spacing to blade templating markers.
Supports the following tags
4. Laravel Extra Intellisense
Laravel Extra Intellisense provides Laravel route, views and autocompletes for VS Code
Some of the autocomplete features are
- Route names and route parameters
- Views and variables
- Translations and translation parameters
- Laravel mix function
- Validation rules
- View sections and stacks
You can also check the documentation on how to set it up.
5. Laravel goto view
This is one of my favourite extensions when developing in Laravel, this extension helps you go to a particular view when clicked.
How to use this extension
You can use
Alt + click to jump to the first matched Blade View file
DotENV extensions helps a lot in VS Code .env sytnax highlighting
You can check DotENV documentation for more information.
7. Laravel Snippets
Laravel snippets extension for VS Code Support Laravel 5 and above, this snippet provides prefix follows Laravel Facades for example
Support Snippets Prefix
Browse the documentation for more about the Laravel Snippets extensions
8. Laravel goto controller
As your application grows, the number of your Controllers grows as well, so at some point, you might end up with hundreds of controllers. Hance finding your way around might get tedious.
This is the exact problem that the Laravel-goto-controller VScode extension solves.
The extension allows you to press
Alt + click on the name of the controller in your routes file, and it will navigate you from the route to the respective controller file:
For more information, make sure to check the documentation here:
9. PHP Namespace Resolver
PHP Namespace Resolver can import and expand your class. You can also sort your imported classes by line or in alphabetical order.
For more details, you can check the online documentation on more configurations
10. PHP Formatter
After installing as an extension with Visual Studio Code, this extension automatically formats your PHP code, in accordance with PSR-0, PSR-1, PSR-2 or Symfony style conventions.
Some of the features are:
- Format current selection only, or the whole file.
- Trigger formatting with custom keybindings or actions.
- Supports formatting on save.
- Supports adjustable level (i.e. PSR2) and fixers.
- Can be configured to support other file extensions than PHP as well, i.e. “.inc” files.
- Supports different PHP-CS-Fixer installation methods, i.e. Composer vs manual installation.
For more on how to set up and use the PHP formatter on VS Code, you can go through the online documentation
If you like all those extensions, you can take a look at the Laravel Extension Pack on VS Code, where you could get all of the mentioned extensions as 1 bundle!
The only extension not included in the pack is the Laravel Blade Spacer, so make sure to install it separately!
I hope that this helps!