You need a bash interpreter, Git Bash will work, you probably have it installed already
Laravel Sail: "Sail up" command not running
I thought I would try out Laravel Sail, since I've been using Laradock for a few years and hoping to simplify my dev environment setup a little bit more. I am on Windows 10 64, Docker Desktop 3.0 installed using WSL 2, and my Laravel app is running Laravel 8.20.1.
In my Laravel project, I've followed the Laravel Sail setup guide: I've run composer require laravel/sail --dev and php artisan sail:install, and I see the docker-compose.yml in my root directory.
Everything so far seems ok.
But when I run ./vendor/bin/sail up from PowerShell I get a "How do you want to open this file" prompt in Windows.
What am I missing here?
@artessan thank you for the clarification.
Coming from Laradock, I made some false assumptions about Sail. I'm going to leave some notes for anyone else coming across this who thought it worked like Laradock in Windows:
You need to have a linux distro installed (eg, Ubuntu), and make sure it is set as the default wls2 environment (wsl -s <distro name>) . See more detailed steps about this setup at https://docs.microsoft.com/en-us/windows/wsl/install-win10#step-4---download-the-linux-kernel-update-package.
Once I did these steps, I was able to open Windows Terminal, create an Ubuntu tab, and run ./vendor/bin/sail up and it executed.
Ideally, you want your project installed in the OS files systsem, as opposed to the mounted Windows folders. Otherwise the web server runs really slowly. However, there is a downside: If you have your project inside WLS2, it's a bit trickier to edit your project files in Windows, hence the recommendation in the Laravel docs to use VS Code, since it has a built-in way to manipulate files inside WLS2. IntelliJ claims to be working on this for PHP, but I don't know the exact status.
I've decided to go back to Laradock for the time being since it performs fast with Docker in Hyper-V mode, but I'll keep my eye on Sail and come back once IntelliJ has a good solution for working with WLS2 files.
Please or to participate in this conversation.