When you setup Valet in your Mac, you may encounter an error message “Error: Could not symlink sbin/php-fpm

If you encounter the above error message, try creating the “sbin” folder under /usr/local/ directory and give it the necessary user and folder permission to it.

Once that is done, go ahead with linking php using brew and then installing Valet. Some useful commands with a series of steps for configuring laravel with Valet are presented below

$ brew update

$ brew install php
$ brew install composer
$ composer global require laravel/valet
$ composer create-project laravel/laravel laravelapp
$ brew link --force php@8.4
$ echo 'export PATH="/usr/local/opt/php@8.2/bin:$PATH"' >> ~/.zshrc
$ echo 'export PATH="/usr/local/opt/php@8.2/sbin:$PATH"' >> ~/.zshrc
$ valet install
$ mkdir ~/Sites
$ cd Sites
$ valet park (now all folders under ~/Sites folder is parked and can be accessed with a dnsmasq)