Valet
What is Valet?
Valet is a development environment that configures your Mac to always run nginx
in the background when your machine starts.
nginx
is software for web serving, reverse proxying, caching, load balancing, media streaming, and more.
Then, using dnsmasq
, Valet proxies all requests on the \*.test
domain to point to sites installed on your local machine.
dnsmasq
(short for Domain Name System masquerade) is a lightweight, easy to configure DNS forwarder, designed to provide services to a small-scale network.
Our test domain will be .wldev
WARNING
You should make sure that no other programs such as Apache or Nginx are binding to your local machine's port 80
before installing.
- Install Valet.
$ composer global require laravel/valet
$ valet install
composer
is a tool for dependency management in PHP
. It allows you to declare the libraries your project depends on and it will manage them for you.
- Set your top-level domain
$ valet tld wldev
$ valet start
Valet allows you to switch PHP versions using the valet use php@version command.
$ valet use php@7.3
Resetting Your Installation
If you are having trouble getting your Valet installation to run properly, executing the
composer global update command
valet uninstall --force
valet install
will reset your installation and can solve a variety of problems.