Last-Update: 28 may 2020. It is always fun to install a new laptop. In this case I upgraded my 'old' MacBook Pro from mid-2015 to a fresh MacBook Pro 16" variant. And I have to say what a beauty that machine is. It has a i9 processor on board with 64 GB of RAM, and it just crushes loading times of applications.
During the installation it gives me some crinches though. In this case OSX Catalina which now defaults to ZSH instead of bash due to licensing issues. I do not have a particular opinion about either choices, but I do had some issues with some paths settings that werent picked up in the shell. It seems that zsh it can not parse a "~" and escapes a "$" in the path settings and at that time I thought, lets write a new blog post about my installations for a fresh MAcBook Pro to install all the stuff you need to get Laravel Valet up and running. (It saves me time also to link to this for friends ;) ..)
Installing the tools
This is a small list we are going to install on the system
- laravel valet
- laravel installer
- laravel envoy
The swiss army knife needed on every OSX machine. Run these commands in the terminal to install Homebrew and also add /usr/local/sbin to your global PATH setting.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer
Now setup the global PATH to your system for global vendor directory.
cd ~ echo "$PWD/.composer/vendor/bin" | sudo tee -a /etc/paths.d/40-composer
Restart your terminal to take the changes in effect for the paths. Notice the $PWD, it will replace the path to your users root in this case. This will make sure that ZSH can use your home directory and not needing the ~ to load the path.
Install the latest version of PHP on the system with homebrew.
brew install php brew services start php
You can verify the installation running php -v in the terminal. It will show version PHP 7.4 at the time of writing.
brew install email@example.com brew services start firstname.lastname@example.org
If you want to use mysql also via the CLI then run the following command also:
echo "/email@example.com/bin" | sudo tee -a /etc/paths.d/50-mysql
After the installation the default user is root, and the password will be blank (like empty string: "").
brew install redis brew services start redis
composer global require laravel/valet valet install
composer global require laravel/installer
composer global require laravel/envoy
Finishing the installation
You can now setup a folder to park your sites in to holster your projects. In this case I will assume it will be Sites under the users directory.
mkdir ~/Sites cd ~/Sites valet park
You may now have a working Valet Installation to test out by installing a Laravel project in this new Sites folder.
laravel new laravel
After completing the installation of the Laravel Application, open up a browser and go to http://laravel.test and you should be good to go.