7

I have an existing Laravel project, which I want to run in my browser, using VS Code. How do I do this?

1
  • 1
    VS Code is just a code editor afaik, you would still need a local webserver to run it. (e.g. apache2, or php artisan serve) Commented May 3, 2018 at 8:07

1 Answer 1

12

There's a built-in terminal in vs code (on a different tab somewhere in the bottom), you can use it to serve your project by a local webserver, with the following command:

php artisan serve

After that you can see your project in your browser (localhost:8000 by default).

Please note this might not work out of the box on Windows.

Sign up to request clarification or add additional context in comments.

11 Comments

Ok, I managed to get my Laravel project to show in my browser. I need to now proceed in debugging this project when it is running in the browser. How do I determine which file in the Laravel project must I place my first Breakpoint so that I can follow the flow of the project?
It depends on where it crashes, you can see it in the error message.
It isn't crashing. When I work in Visual Studio, I normally place a Breakpoint in one of the files which is an entry point to the project. This then allows me to follow the flow of the project from that point. I am trying to do the same in this Laravel project in VS Code, but I don't know which file is the entry point of the project. Placing a Breakpoint in the index.php file isn't doing anything?
The entry point of the application is public/index.php, I recommend checking the documentation here: laravel.com/docs/5.6/lifecycle
You can stop execution with this function: dd($foo). Check this question on breakpoints: stackoverflow.com/questions/28501077/…
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.