Setup vsCode for Laravel Development

Visual Studio Code(vsCode) is a highly customizable code editor. it can be taken next level if you configure it properly for specific use cases. In this post, we’ll setup vsCode for Laravel development.

Extensions

PHP Intelephense

it’s a very much required extension if you want to do PHP development in vscode. Gives you proper autocompletion, error hinting, goto type definition, provides autocompletion based on docs comments, etc. It’s also provides you with WordPress code completion but by default not enabled.

Laravel Extra Intellisense

another required extension for good auto-completion. It will provide you with a better view, validation rules, ENV, configs, etc. auto-completion.

PHPDoc Generator

I found it good to regularly write docs for classes and functions. To get the PHPDoc Generator to generate a PHPDoc block, place the cursor on a line with a class, method, or property and press Control+Enter.

Laravel Blade formatted

It’ll auto-format blade files after saving.

Laravel Blade Snippets

Some essential snippets for Laravel blade files. For example, b:foreach will set foreach loop block, b:if-else will set if-else condition block. For more snippets, you may read the extension’s details.

ENV

.env file’s syntax highlighting.

Better Pest

The under-rated extension helps you to run pest tests from a file, under a test scope, and globally.

My personal keyboard shortcuts for these extensions

  {
    "key": "alt+r",
    "command": "better-pest.run"
  },
  {
    "key": "cmd+k cmd+r",
    "command": "-better-pest.run"
  },
  {
    "key": "alt+f",
    "command": "better-pest.run-file"
  },
  {
    "key": "cmd+k cmd+f",
    "command": "-better-pest.run-file"
  }
JSON

Below these videos, use alt+r to run a single test scope and entire file.

Pest Snippets

provides some snippets for quickly writing pest related common block of codes.

  • :pte to access all test() snippets.
  • :pti to access all it() snippets.
  • :pex to access the available expect() methods.

Thanks.

Istiaq Nirab

A highly skilled and proficient WordPress developer with over Three years of professional experience in all aspects of WordPress website creation, including design, plug-ins, and implementation. Results-driven individual contributor with a successful track record in exceeding expectations for web development initiatives

More Reading

Post navigation

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *