VSCode for PHP and Laravel

<p>This post should help you setup Visual Studio Code to use for PHP and Laravel development. It it a solid base configuration that can be expanded upon using additional workspace specific configurations. I will cover the best extensions to use as well as some helpful configuration settings and external tools.</p> <p>Let&rsquo;s get started with the most important extensions!</p> <h1><strong>Intelephense</strong></h1> <ul> <li><a href="https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client" rel="noopener ugc nofollow" target="_blank">PHP Intelephense &mdash; Visual Studio Marketplace</a></li> <li><a href="https://intelephense.com/" rel="noopener ugc nofollow" target="_blank">Intelephense</a></li> </ul> <p>This is the most important extension to install for PHP support. It provides a fast language server that adds code completion, go to definition, formatting, and more. You can also purchase a license at&nbsp;<a href="https://intelephense.com/" rel="noopener ugc nofollow" target="_blank">Intelephense</a>, which I highly recommend. It adds some additional features like renaming symbols and other code actions.</p> <p>Once installed, disable the built-in PHP features so Intelephense is used instead:</p> <p><img alt="Disable built-in PHP settings" src="https://miro.medium.com/v2/resize:fit:630/1*7CWjkqJuI2vjJhfPzS7oVQ.png" style="height:133px; width:700px" /></p> <p>Disable built-in PHP settings</p> <p>If a license was purchased, use&nbsp;<code>cmd+shift+p</code>&nbsp;to bring up the Command Palette and search for &ldquo;Enter licence key&rdquo;.</p> <p>For the most part, the default settings are fine for Intelephense. At a workspace level, setting the document path and PHP version can be helpful if working on multiple PHP projects and frameworks.</p> <p><a href="https://blog.stackademic.com/vscode-for-php-and-laravel-ee04a37c1047">Read More</a></p>