Istiaq Nirab full stack + ai
← Writing
Laravel Sep 22, 2023

Setup vsCode for Laravel Development

The extensions and keyboard shortcuts that turn Visual Studio Code into a proper Laravel editor.

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

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

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

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

Laravel Blade formatted

It'll auto-format blade files after saving.

Laravel Blade Snippets

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

.env file's syntax highlighting.

Better Pest

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"
  }

Pest Snippets

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.

Discussion

Comments run on giscus, backed by GitHub Discussions — sign in with GitHub to reply.

More posts
WooCommerce

WooCommerce : Change product's add-to-cart button text

Change the add-to-cart button text of WooCommerce products with plugins or with two filter hooks.

2023-09-22
WooCommerce

WooCommerce apply coupon via url

Apply woocommerce coupon via custom url

2023-03-19
vsCode

vsCode Configuration for WordPress Plugin

Configure vscode to experience better on develop WordPress Plugin.

2022-12-17
ContactGMT+6

Have something that needs building, fixing, or finishing? Write one paragraph — that's usually enough.

open to new work
Local time--:--:--
Based inDhaka, BD
Experience6+ years