Create Laravel Sail project in WSL and configure it in VS Code Emman, November 3, 2023November 3, 2023 To create a new Laravel Sail CRUD project using the curl command and then configure it in Visual Studio Code, you can follow these steps: Note: Ensure you have WSL (Windows Subsystem for Linux) set up and Docker installed, as Sail relies on these technologies. Create a New Laravel Project: In your WSL Ubuntu terminal, use the curl command to create a new Laravel project with Sail: curl -s https://laravel.build/myApp | bash Replace myApp with your desired project name. This command will set up a new Laravel project with Sail using the Laravel Sail build script. Open the Project in Visual Studio Code: After the project is created, navigate to the project directory. You can use the cd command to change to the project directory: cd myApp Next, open the project in Visual Studio Code using the code command. If you haven’t already, make sure you have the Visual Studio Code installed in Windows: code . This will open Visual Studio Code with the Laravel project. Configure the Project in Visual Studio Code: Once the project is open in Visual Studio Code, you can configure it further: a. Install Visual Studio Code Extensions: You may want to install some Laravel-specific extensions for Visual Studio Code. These extensions can provide features like syntax highlighting, code completion, and more. You can search for and install extensions from the Visual Studio Code marketplace. b. Set Up Debugging: To configure debugging for Laravel in Visual Studio Code, you can create a launch.json configuration for your project. Click on the “Run and Debug” button on the left sidebar in Visual Studio Code, then click on “Add Configuration” and select “PHP”. Modify the launch.json configuration to suit your project’s needs. Here’s an example launch.json configuration for Laravel: { "version": "0.2.0", "configurations": [ { "name": "Listen for Xdebug", "type": "php", "request": "launch", "port": 9000, "pathMappings": { "/var/www/html": "${workspaceFolder}" }, "log": true, "xdebugSettings": { "max_data": 65535 } } ] } c. Set Up Terminal: Visual Studio Code has an integrated terminal. You can open a terminal window within Visual Studio Code by clicking on “Terminal” in the top menu and then selecting “New Terminal.” d. Start Sail: You can start your Laravel Sail development environment from the integrated terminal by running: sail up Now, you should have your Laravel Sail project created, configured in Visual Studio Code, and the development environment running within WSL. You can start building your Laravel application and use Visual Studio Code for coding and debugging. Share this:FacebookX Related Discover more from Code Concepts Snippets Subscribe to get the latest posts sent to your email. Type your email… Subscribe Docker Laravel PHP