Laravel Valet Windows 3

The original Laravel Valet is a development environment and CLI for macOS developed by the Laravel team to auto-start a NGINX server and serve local sites over the server with per-site PHP version support amongst other features. Laravel Valet for Windows was an old unmaintained and outdated fork of the original that had promise to be a Windows port.

Visit GitHub
Built with ComposerGitGitHubLaravelPHPPowerShellSymfony

The challenge

I had previously used Laravel Valet on macOS for a short period of time, when I moved back to my Windows machine, I missed Valet. It was like XAMPP but with superpowers. I tried the Laravel Valet for Windows fork, but I quickly found out that it lacked the most up to date features, including the multi-PHP support and per-site PHP version support. There was a pull request for adding this missing feature, but it was never merged, and it seemed the project was inactive. So, I took it upon myself to create a fork of the pull request, to get the updated code, and work on adding other features that I needed for my own local development.

The solution

It took me 4 months of painstakingly learning how to code a CLI and convert the various macOS exclusive functionality to a Windows variation. I learnt how the Silly (a wrapper for Symfony Console) Composer package is used to create CLI commands and feed user input into the command functions. I learnt that PHP isn’t just for creating websites, but it can be used to create a piece of software and interact with a CLI. Because PHP is the main tech used, I found it relatively easy to code the functionality.

At first, I set my sights on adding all the pull requests into my project and enhancing the code and functionality to my own needs. But then I wanted to achieve parity with the original macOS version. This significantly increased the workload and learning because I had to get around lots of annoying bugs creating new functions and converting old functions to work with Windows, and even coding a diagnose command for the various services it uses.

It achieves 87% parity of a possible 92%. It already has lots of functionality and yet I’m already thinking of more I could add. The fact that I was able to adapt this CLI for my own needs makes me so proud. I have released it to the public under the official name Laravel Valet Windows 3 at version 3.0.0 and installable via Composer.