Laravel 9 starter project pre-configured for VSCode (WSL2) with extensions for syntax highlighting, intellisense, code formatting, phpunit, and more.
Full write-up: https://kleypot.com/laravel-development-windows-2022/
Requires WSL, Docker, and VSCode.
- Clone
$ git clone https://github.com/akmolina28/laravel-vscode-example
$ cd laravel-vscode-example
- Create .env file, edit as desired
$ cp .env.example .env
$ nano .env
- Install Composer packages (including Sail)
$ docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php81-composer:latest \
composer install --ignore-platform-reqs
- Start Sail
$ ./vendor/bin/sail up -d
- Finish Laravel Setup
$ sail artisan migrate
$ sail artisan key:generate
$ sail npm install
- Open VSCode
$ code .
-
From the command palette (ctrl+shift+p) run "Run Test Task" and open the APP_URL
-
Install extensions (see workspace recommendations)