How To Install “Valet” And “wp valet” Command
Valet is a development environment for Laravel.
Valet is a Laravel development environment for Mac minimalists. No Vagrant, no
/etc/hosts
file. You can even share your sites publicly using local tunnels. Yeah, we like it too.Laravel Valet configures your Mac to always run Nginx in the background when your machine starts. Then, using DnsMasq, Valet proxies all requests on the
*.dev
domain to point to sites installed on your local machine.
https://laravel.com/docs/5.4/valet
And it supports WordPress too.
How To Install Valet
It was easy. 🙂
Install following packages with Homebrew.
- Nginx
- Dnsmasq
- PHP7 or later
- MySQL
Install Valet with Composer.
$ composer global require laravel/valet
Then run following command.
$ valet install
WP-CLI Valet Command
@aaemnnosttv developed a wp valet
command which is really useful to launch WordPress on Valet.
https://github.com/aaemnnosttv/wp-cli-valet-command
You can install it with following command.
$ wp package install aaemnnosttv/wp-cli-valet-command
Then you can launch WordPress like following.
$ wp valet new hello Don't go anywhere, this should only take a second... Success: hello ready! https://hello.dev
Then you can visit https://hello.dev/
.
You can delete it with the following command when it becomes unnecessary
$ wp valet destroy hello
This command has many option, you can see them with help.
$wp help valet new NAME wp valet new DESCRIPTION Create a new WordPress install -- fast SYNOPSIS wp valet new <name> [--project=<project>] [--in=<dir>] [--version=<version>] [--locale=<locale>] [--db=<db>] [--dbname=<dbname>] [--dbuser=<dbuser>] [--dbpass=<dbpass>] [--dbprefix=<dbprefix>] [--admin_user=<username>] [--admin_password=<password>] [--admin_email=<email>] [--unsecure] [--portable]