eptic / valet-wsl
Advanced local development experience for Windows Subsystem for Linux.
Requires
- php: ^8.1|^8.2
- ext-json: *
- ext-posix: *
- illuminate/collections: ^8.0|^9.0|^10.0
- illuminate/container: ^8.0|^9.0|^10.0
- mnapoli/silly: ~1.1
- nategood/httpful: ~0.2
- symfony/console: ~6.3
- symfony/process: ^3.0|^4.0|^5.0|^6.0
Requires (Dev)
- mockery/mockery: ~1.6.4
- phpunit/phpunit: ^10.2
- dev-master
- v2.0.1
- v2.0.0
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-dependabot/composer/symfony/process-tw-7.1.3
- dev-dependabot/composer/illuminate/collections-tw-11.15.0
- dev-dependabot/composer/phpunit/phpunit-tw-11.2
- dev-dependabot/composer/symfony/console-approx-7.1
- dev-dependabot/composer/nategood/httpful-approx-1.0
- dev-docs
This package is auto-updated.
Last update: 2024-10-26 23:01:52 UTC
README
Introduction
Valet WSL is an advanced development environment for Windows Subsystem for Linux.
No Vagrant, no hosts
file manual management. You can even share your sites publicly using local tunnels. Yeah, we
like it too.
Valet WSL configures your system to always run Nginx in the background when your machine starts. Because of the WSL limitations, DnsMasq is not used, instead valet manages the hosts files when any website is linked or unlinked.
In other words, a blazing fast PHP development environment that uses roughly 7mb of RAM. Valet WSL isn't a complete replacement for Valet Linux+, Laravel Valet, Vagrant or Homestead, but provides a great alternative if you want flexible basics, prefer extreme speed, or are working on a machine with a limited amount of RAM.
This is a port of Valet Linux+ made for WSL. If you want the DnsMasq version of this project, please check it out.
Official Documentation
Installing Valet WSL
Important
- Always run Valet commands from a WSL shell runned as administrator.
Requirements
Installation
- Install or update PHP to one of the versions mentioned in the requirements.
- Install Composer from the official website.
- Install Valet WSL with Composer via
composer global require eptic/valet-wsl
. - Add
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
to your.bashrc
file. - Run the
valet install
command. This will configure and install Valet WSL with all the required services, it will also register the Valet's daemon to launch when your system starts. - Once Valet WSL is installed, you can run
valet start
to start all the services, and you can check if valet is working by visiting the pagehttp://localhost
.
Switching PHP Version
Switch PHP version using the command:
valet use <version>
Example:
valet use 8.1
Use --update-cli
flag to update PHP cli version as well.
Database
Valet WSL automatically installs MySQL. It includes a tweaked my.cnf which is aimed at improving speed.
Change password
It can be single line of code to change your MySQL password. We don't have to always login to MySQL and find for the query and execute it. It's just that simple as below:
valet db:password <old-password> <new-password>
List databases
valet db:list
Creating database
Create a new database using:
valet db:create <database-name>
When no name is given it will use the current working directory as the name of the database
valet db:create
Dropping database
valet db:drop <name>
When no name is given it will use the current working directory as the name of the database
valet db:drop
Domain Alias / Symlinks
Display all of the registered symbolic links:
valet links
Add the current folder as a symlink:
valet link
For example:
$(/src/beel) valet link
This will create a symbolic link for the current folder and point it to beel.test
Securing sites with TLS
By default, Valet serves sites over plain HTTP. However, if you would like to serve a site over encrypted TLS using HTTP/2, use the secure command.
For example, if your site is being served by Valet on the example.test
domain, you should run the following command to secure it:
valet secure example
If you don't provide the name and the current working directory is linked to a domain, it will use the current working directory as the domain.
$(/src/beel) valet secure
This will make beel.test
to work with https://beel.test
License
Valet WSL is open-sourced software licensed under the MIT license