Valet
Valet is a Laravel development environment for macOS minimalists.
Install
Follow the install docs.
Commands
Managing Valet
valet start |
Start the Valet daemon. |
valet restart |
Restart the Valet daemon. |
valet stop |
Stop the Valet daemon. |
valet uninstall |
Uninstall the Valet daemon entirely. |
Run valet stop
before enabling other environments which use the same ports (MAMP/Docker/etc).
Managing sites
The link
command
- Navigate to folder:
cd ~/path/to/site/root
- Run
valet link {linkName}
- The site will be available as:
http://{linkName}.test
valet link {linkName} |
Add a linked directory. |
valet links |
View all of your linked paths. |
valet unlink {linkName} |
Remove a linked directory. |
The park
command
I don’t use valet park
at all.
- Navigate to folder:
cd ~/path/to/sites
- Run
valet park
- Each sub-folder will be available as:
http://foldername.test
valet park |
Link all sub-folders as: http://foldername.test |
valet paths |
View all of your “parked” paths. |
valet forget |
Run this command from a “parked” directory to remove it from the parked directory list. |
Managing databases
Download DBngn for simple database management on macOS.
- Username:
root
- Password: “
Securing sites
Command | Outcome |
---|---|
valet secure hobbiton |
https://hobbiton.test |
valet unsecure hobbiton |
http://hobbiton.test |
Sharing sites
- Navigate to the site’s path in terminal.
- Run
valet share
. - Copy the site URL.
- Type
Control + C
to stop sharing.
Switch PHP version
valet use [email protected]
or valet use [email protected]
You might need to run valet restart
afterwards.
Troubleshooting
Fix local SSL/TLS certificate isn’t trusted
- Open “Keychain Access” (Mac app).
- Search for “valet”.
- Delete all saved certificates related to Valet.
- Update the
valet
package:composer global require laravel/valet
- Run
valet install
. - Run
valet links
and screenshot for reference. - Remove old config:
rm ~/.config/valet/CA/*
rm ~/.config/valet/Certificates/*
rm ~/.config/valet/Nginx/*
rm ~/.config/valet/Sites/*
Then manually valet link
and valet secure
to create local sites again.
Reference: Github: laravel/valet, Issue 296