To run your Laravel project in VScode, you need to follow these steps:
1. Open VScode and install the PHP extension. You can do this by clicking on the extensions icon on the left-hand side of the window, searching for "PHP" and clicking install.
2. Install the Laravel extension for VScode. In the same extensions tab, search for "Laravel" and click install.
3. Open your Laravel project in VScode by clicking on the "Open Folder" button on the welcome screen or by going to File > Open Folder and selecting your Laravel project folder.
4. Open a terminal window within VScode by going to View > Terminal or by using the keyboard shortcut
Ctrl+Shift+~
5. Run the following command in the terminal to install the required dependencies:
6. Create a
.env
file by running the following command in the terminal:
This command creates a copy of the
.env.example
file and renames it to
.env
. This file contains your application's environment variables.
7. Generate a new application key by running the following command in the terminal:
This command generates a new application key which is used for encrypting data.
8. Finally, start the development server by running the following command in the terminal:
This command will start the development server at
http://localhost:8000
.
You can now access your Laravel application by opening your web browser and going to
http://localhost:8000
.