A custom driver for Laravel Valet that adds compatibility for WordPress multisite installs that use the subdirectory configuration.
git clone https://github.com/Objectivco/WordPressMultisiteSubdirectoryValetDriver.git
cd WordPressMultisiteSubdirectoryValetDriver
cp WordPressMultisiteSubdirectoryValetDriver.php ~/.valet/Drivers
- Make sure your wp-config.php file has at least one of WP_ALLOW_MULTISITE or MULTISITE constants defined.
- Celebrate the pain you just avoided!
If your install has WordPress root files in a subdirectory (such as a submodule), simply change the class property $wp_root
from false to the root directory name.
This only works with the subdirectory URL scheme. If you have a subdomain site setup with Valet, this driver will probably break it. You'll need to modify the serves()
function to prevent this driver from handling the request.