DEV Community

Cover image for VSCode for PHP and Laravel

VSCode for PHP and Laravel

Sean Kegel on August 21, 2023

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 ...
Collapse
 
cwprogram profile image
Chris White

I really enjoyed the effort put into this article. Actually quite impressed at the level of code completion offered through the various plugins. The examples were laid out nicely and I appreciate seeing a full settings file available at the end. Thanks for the great article!

Collapse
 
msamgan profile image
Mohammed Samgan Khan

I agree for most of the part but if you are using laravel, instead of using Prettier you should use laravel pint. Here is a way you can use laravel pint in your vscode setup
codebysamgan.com/how-to-add-larave.... Moreover I also created an extension for the same purpose, you should check out.
marketplace.visualstudio.com/items...

Collapse
 
sean_kegel profile image
Sean Kegel

I use both Prettier and Pint. I use Prettier for formatting frontend code like React/Vue. However, I also use it for Blade templates since Pint does not format Blade templates.

Prettier can also sort Tailwind classes as well which I prefer.

All my normal PHP files are formatted with Pint, Prettier does not touch those.

Collapse
 
msamgan profile image
Mohammed Samgan Khan

yes combining them together is a great idea. I do the same.

Collapse
 
sergunik profile image
Serhii

Maybe I’m blind but can you explain specifically for me - WHY?
PHPStorm is perfect IDE for it. Why need to invent bicycle and try to setup the rest of tools for it?

Collapse
 
sean_kegel profile image
Sean Kegel

PhpStorm is fantastic and if you have the money or your company provides it, than definitely, you should be using it. It is what I personally use for PHP development. However, there are many people that use VSCode for a lot more than PHP and are comfortable in that environment. So I hope this article can help them.

Collapse
 
msamgan profile image
Mohammed Samgan Khan

very few people know about this but JetBrains also provides open-source licenses, If you work on any open-source project you can apply for this, here is the link jetbrains.com/community/opensource...

Collapse
 
jagdishjp profile image
Jagdish Patel

Because PHPStorm is charging you good amount of money for the features which are easily available in VSCode free of cost.

Collapse
 
sergunik profile image
Serhii • Edited

I'll respond you in BDD style))
Given enough engineering skills
When I'm as a Software Engineer want to have a well-paid job (have a payment for my engineering stuff)
And have updates to software tools that I use
Then I need to pay for software tools that I use
And pay for movies, music, news, etc.

Does it makes sense?

Thread Thread
 
drsimplegraffiti profile image
Abayomi Ogunnusi

Nice article

Collapse
 
shjordan profile image
Jordan Humberto de Souza

You should give Laravel Pint a try.

Collapse
 
shjordan profile image
Jordan Humberto de Souza

You should give Laravel Pint a try