Posted: 02-03-2019

Switching PHP version with Laravel Valet use

Switching PHP version with Laravel Valet use

Switching PHP version on your Mac is one of the most tedious and painful task.
Just discoverd that Laravel Valet can do this job for you.
Valet allows you to switch PHP versions using the valet use php@version command.
Valet will install the specified PHP version via Brew if it is not already installed:

valet use php@5.6 
valet use php
valet use php@7.2

I've tried on My macPro with macOS 10.14.3 Mojave and seems to work well.
Caveat
I need to restart my machine in order to have the select php version runnig.
Additional resources
Laravel Valet official docs.
macOS 10.14 Mojave Apache Setup: Multiple PHP Versions