I am new to using the Laravel framework. I want to use VS Code for debugging my Laravel project. How do I Launch my Laravel project in VS Code?
1 Answer
Open the folder in VS Code.
If you are using Homestead press Ctrl+J (on Windows) or Cmd+J (on macOS), then type vagrant up. Otherwise type php artisan serve.
9 Comments
Fred
Jasper, after launching the Laravel project in VS Code, where to do I go to debug the project. I don't have a clue where to start? Do I open the index.php file and in Debug select "Launch Currently Open Script"?
Jasper
For debugging a php project i myself use some create extensions. Go too the extensions tab on the left. And install PHP intelephense. After indexing your project it will read out all syntax errors and more. Duplicate function names, wrong test names. It works great for debugging
Jasper
I think what you are trying to do is run php inside your vs code? Since you need apache for that youll need alot of modifying to run it. Maybe try this? laravel.com/docs/master/homestead#per-project-installation
Jasper
I think i found what you are searching for! Install PHP debug it utilyses the php Xdebug extension! PHP Debug marketplace.visualstudio.com/…
Fred
This is what I've done: I have installed PHP Debug. In the VS Code terminal I "vagrant up" and confirm it is running. In VS Code "Debug" window I ensure it says "Listen for XDebug". I then select "Start Debugging". What is supposed to happen next? Is there a specific file in the Laravel project that should be focused or that I should be running "Start Debugging" from? What am I missing?
|